Use The Correct Values For The Constants?
Sep 24, 2010
The code underneath works when I use WM_MOUSEMOVE but not when I use WM_NCMOUSEMOVE. Is WM_NCMOUSEMOVE not supported anymore?I use the correct values for the constants too.Protected Overrides Sub WndProc(ByRef m As Message)Dim MousePosition As Point
Select Case m.Msg Case WM_NCMOUSEMOVE MousePosition = New Point(m.LParam.ToInt32())
If MousePosition.Y < 50 Then CloseButtonState = ButtonState.Flat
Else
CloseButtonState = ButtonState.Normal
[Code]...
View 14 Replies
ADVERTISEMENT
May 11, 2010
I need a source for the VALUES of the constants used for dealing with video using SendMessage.
View 11 Replies
Jun 1, 2009
I have a list of rather meaningless codes that I'm processing with a VB.NET Windows application. For the business logic I'm writing to process those codes, I'd like to use meaningful constants (like ServiceNotCovered or MemberNotEligible) instead of the original codes (like "SNCV" and "MNEL").As far as I can tell, Enums can only map to numeric values, not to strings. So the best I've been able to come up with is a static class that exposes the constants as static readonly string fields that are internally set equal to the code values, as follows.
Public Class MyClass
private _reasonCode as String()
Public Property ReasonCode() As String
[code].....
View 7 Replies
Sep 21, 2009
I have a class in VB with some constants that represent the string name of my security roles. I need to be able to call a function to return to me a string array(or collection, or whatever) of the values of each of these constants. I will be using it to make sure that my databases Roles table has the same roles as coded into the application.
[Code]...
I'm looking to run a function, i.e. ClassConstantsToStringArray(gettype(Roles)) that will return to me "Administrator","Basic User","Power User" I'm know reflection is the way to go, I just don't know enough about using it yet to get what I want. I found a function on the net that would return to me the constant names in a FieldInfo array but still don't have enough smarts to make that work for me.
View 3 Replies
May 15, 2010
Is it correct to correct properties values on the fly? for example: (note the .ToLower)
Public Property X() As String
Get
Return _x.ToLower
End Get
[code]....
View 1 Replies
Apr 17, 2012
My VB code uses a timer with a slider, and uses AddSeconds. I am trying to use the slider with a min value of 0 and max value of 600, and set up ticks every 30 seconds between 0 and 600.At a beginner level coding VB,I am not sure how to set some of the correct values in the slider's property box.Min, Max and Value, I am guessing are 0, 600 and 0 (sets the slider thumb starting positionat the far left). But I am not sure what other values, like tick and small and large change, etc. need to be set and set to what value? I've read online, but so far cannot find how to configure this.
View 10 Replies
Nov 17, 2011
Cannot gen. the correct wave values?
View 2 Replies
May 31, 2012
I am calling this function when a button is CLICKED and received the error; The name "The" is not permitted in this context. Valid expression are constants, constants expression, and (in some contexts) variables. Column names are not permitted. Unclosed quotation mark after the character string 'True)'.
The function is as follows;
Private Sub Save()
Dim conn As SqlConnection = GetDbConnection()
Dim query As String
Dim cmd As New SqlCommand
View 3 Replies
Jun 18, 2009
Ok simply my code doesnt want to output the correct number. I'm working on the project euler probems to expand my knowledge in VB.net and the current question I am working on is asking to work with triangle numbers. while researching I found that a triangle number can be calculated by using the formula:
[Code]....
View 5 Replies
Nov 29, 2011
I got 100+ textboxes that display record values. Most of the textboxes display correct values but several textboxes doesn't. These are the same textboxes. And they only display wrong values if I edit a record for the first time. After correcting the wrong values in the textboxes the first time, they display correct values in succeeding editing of records. Tried to compare their properties and all but they are the same with textboxes that worked...
Private Sub english_proficiency_answersheet_Form_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
Me.Text = "EPT Answer Sheet of " & gsLastName & ", " & gsFirstName & " " & gsMiddleName
[Code].....
View 3 Replies
Aug 30, 2011
An exert from my config file looks liek this.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
[Code].....
EDIT: I am able to pass in the string perfectly when using Visual Studio 2005. But when using VS 2003 and a loiwer .net framework it will not let me, unless I hard code it in.
Could something be enabled/disabled on one of these instances of VS? Or could this just be an error with the older versions of .net? I think I am using 1.1??(will have to check) in 2003.
View 2 Replies
May 10, 2011
I've created a log in system using a database and query builder to return the correct values, however, once the users signed in I need to bring up the rest of their data from the same table in the database. How'd be the best way of going about this? I'm not sure whether the log in should be changed to use the primary key as well.
View 2 Replies
Jun 8, 2010
i'm working on a system that upgrades a basic version to a proversion but i have a payment gateway . it generates a code in an SQL DB.now i have a form in VB that has a textbox and a button how can i let VB connect to my SQL DB receive the code and then check if that code is correct and if its correct download silence the pro file. from an url.
View 7 Replies
Apr 18, 2009
I have created a basic query generator which allows a user to select the Select, WHERE and criteria attributes using a number of checkboxes.However i have got stuck. In the results form i have the following code
Private Sub DisplayRecord()
RichTextBox1.Text = ds.Tables("newResults").Rows(intCurrentRecord).Item(0)
RichTextBox2.Text = ds.Tables("newResults").Rows(intCurrentRecord).Item(1)
RichTextBox3.Text = ds.Tables("newResults").Rows(intCurrentRecord).Item(2)
[code]....
The program keeps on crashing if the user does not select the corresponding amount of display records from above for the amount of attributes they want for the SELECT part of the query in the intreface in form 1.
How would i go about making something where the number of SELECT attributes selected which are listed in a string create the correct number of textbox fields in the results form (form2)
View 1 Replies
Nov 28, 2010
There are a bunch of constants like vbTab in VB.Net, is there corresponding one in C# ?
View 1 Replies
Apr 24, 2012
i cant understand what constants are.
View 3 Replies
Jun 29, 2010
Say I have some constants that depends one of other, and I decided to keep them together in a container instead of keeping it as individual constants in a class.I thought use a Structure for that scope, but compiler force me to declare a private member for that structure.
[Code]...
View 4 Replies
Jan 8, 2009
How would you declare constants from a .dll, so you can use it in your program.
View 2 Replies
Jan 4, 2010
i was concerned if constants take up storage. if a class had 10 integer constants at class level, will that adds up to 40bytes of storage or is that actually not true because they are constants?
what i'm trying to do: find the best place to put the constants that i need to access at class scope, and whether its best to make them shared or not. [constants are private]
View 31 Replies
Sep 2, 2011
I want to define several constants of pens like SystemPens. How do I do that?
View 6 Replies
Sep 24, 2011
Can anyone explain what the following vbkey constants are as actual key presses? I've tried searching and really can't find any info other than vbKeyCancel = CANCEL key. Well, what's a cancel key? I dont have one on my keybaord...I read somewhere that CANCEL = Ctrl+C. Is that true? If so, what are the other few I have listed?
Constant
Value
Description[code].....
View 2 Replies
Apr 6, 2011
Every time I do something that ends up using windows API calls in VB, I always end up having to look up the values for the windows constants. Does anyone have a file with a class or something for VB that defines all the WIN-API constants?
View 2 Replies
Oct 17, 2011
I have two list boxes that have a list in each and each one has a constant. I am trying to add the selections that are made together and output the total in a third label. I am stuck at this point and am not sure how to proceed, it is entirely possible that i am doing it wrong. Would someone please have a look at this and let me know what the next step would be or if there is a different wayof doing it than I am.[code]...
View 4 Replies
Jul 30, 2010
It would be good if visual basic had standard math constants like pi, the Euler number, and others built-in so one doesn't have to define them each time and have the possibility of making typos. Even some of the physical constants in MKS unit could be included like the Boltzmann's Constant, speed of light, permittivity and such. Each could be a special simple like kb for the Boltzmann's constant. Or it could be a properties like phyconst.c for the speed of light, phyconst.kb for the Boltzmann's, phyconst.sb for the steffan-Boltzmann's constant, pmathconst.e for e=2.71.
View 3 Replies
Dec 10, 2009
Calculate and display the total cost of the sale, as well as the total cost of all sales and the average cost of all sales. - Clear the box for the number of yards, the total cost, and return the quality, padding, and installation settings back to their defaults. Use constants for the cost of each quality of carpeting ($4.95 for Fabulous Flat, $8.95 for Precious Plush, or $12.95 for Super Sculptured), the padding charge ($1.25 per yard), and the installation charge ($3.50 per yard).
[Code]...
View 5 Replies
Feb 23, 2010
I've got a situation where I need a table of constants in my app. It's actually a table of 43 formatting options where the description will appear in a drop down and the detailed settings will be used by the codeIt appears that VB can't do arrays of constants. So I've fiddled around with a Constructor in a class that creates a new array then loads up each element with hard-coded .Add statements. It doesn't seem elegant though.So I then decided to try an XML file, that I load in the Constructor and assign the contents to an array. This is what I've decided is the best, most elegant, option - but I'm throwing this question in to see what you people might recommend ! The data is mostly strings
View 11 Replies
Mar 18, 2009
We're trying to trim the number of assemblies we load during startup, and one of the easiest to cut is the Microsoft.VisualBasic assembly. There are alot of things in it that were easy enough to replace, like Left(), but I'm struggling to find a good way to replace vbLf and Chr(). vbCrLf was easy enough to replace with Environment.NewLine, but we have a few spots where we generate content for a Unix-based system that is expecting line feeds only.
View 5 Replies
Nov 13, 2009
I am exporting data to an Excel spreadsheet from a VB.Net 2008 application. Now I'm trying to format the spreadsheet. So I am creating macros in Excel that format the spreadsheet, and then using the code it generates in my application. The problem is that the constants used in VBA are not being recognized in VB.Net (They are recognized in VB6). I have the following imports:
Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Excel
Is there something else I should be importing? For example, in this line, xlNone and xlDiagonalDown are flagged as not declared.
oXL.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
View 5 Replies
Apr 19, 2012
I'm working with an API that spits out alot of data in name=value format. At first I processed everything by doing simple string comparison:
Sub ProcessData(ByVal name As String, ByVal value As String)
If name = "thisname" Then
DoThis(value)
[code].....
View 2 Replies
Jan 11, 2011
Is it possible to use a constant defined by the compiler in code like below?[code]...
I'm running batch processes and I'm experiencing problems with one of my customer's data. I want to add special code for only that customer, but I want to keep the code there so I can easily switch the customer ID in the future should i need to debug a different customer.[code]...
View 2 Replies