Declare Two Module Level String Variables Name StrCaptital And StrChoice
May 16, 2011
What I'm supposed to do is declare two module level String variables name strCaptital and strChoice and I did that. At least I think I put them in the right place, however what I'm not sure what to do is and I started is that I'm supposed to code each state radio button's click event procedures so that each assigns the appropriate capital to the strCapital variable and then each removes the contents of the lblMsg control.url...
View 3 Replies
ADVERTISEMENT
Aug 16, 2010
how we can declare a connectionstring in a module and call that module
View 1 Replies
May 1, 2009
i could use Global x as string in vb6 in a module to declare it with global privelages, how can i do this in vb2008? how to declare a global variable in vb2008? so that i could use it anywhere i want. i know global variables are not recommended in programming but i need one.
View 4 Replies
Apr 16, 2010
i am trying to create a keyboard hook so when i type out something my app will pop up, regardless of which app has focus at the time.i coded this already in a form which then opens up a second form but now i trying to make it so my module opens first, and then it will open up my secondary form.but the issue i am having is when the module loads and starts the keyhooking, i get an error on the following code saying"Overflow Exception was unhandled, Arthmetic operation resulted in an overflow".[code]
View 1 Replies
Jun 6, 2011
What I am used to declaring database connection is that in every form I type the codes for it which is a tiring way. Now, I want to use module instead but I really don't know how. And also, how will I call the connection to every forms I created?
View 4 Replies
May 25, 2011
below is my code to use binarywriter it work fine on class form1 level
[code]...
View 2 Replies
Oct 10, 2009
Doing a hangman game for class need to know how to declare a form level variable named intNumTries of type integer?
View 1 Replies
Nov 2, 2009
I'd like to declare some members of a module accessible to an entire namespace, but have them not be accessible from without. Is this possible?
View 4 Replies
Feb 4, 2012
I have an issue with variables that are used to name For-Next loops. I have had this problem in a couple programs but not consistently, i.e. some variables work, some throw a warning (not an error).
The situation is this. I declare the variable along with all my declarations in a module-
Module MainModule
Public Counter1 As Integer
end Module 'MainModule
[Code]....
The type for variable 'Counter1' will not be inferred because it is bound to a field in an enclosing scope. Either change the name of 'Counter1', or use the fully qualified name (for example, 'Me.Counter1' or 'MyBase.Counter1'). In the past I've always broken down and changed the names to get rid of all those ugly warnings. Sometimes I have eliminated them from being declared in the module and declared them at call time. This is not how I program and I like to keep consistency throughout.
how I can get rid of this spotty, on-and-off nonsense? There is obviously a lot I don't understand about VS and I would have never taken it up but would have stopped 3 languages ago if I weren't forced into bulkier and bulkier languages (sorry about the rant. I feel OK now).
View 4 Replies
Mar 13, 2009
I just need to know where my code is jacked -up at, I get an error when I created the module level variable ( class statement must end with a matching end class) problem is that every time I add an end class the next procedure is wrong with the same error, so what can I do to resolve this and why is this error coming up. Ultimate goal of this program is to add the invoice totals to the next element in the array each time the user clicks calculate, which displays in a message when the user clicks the exit button, also this code will sort the invoice totals in the array.
Public Class frmInvoiceTotal
Dim SumInvoice(4) As Decimal 'Delareation of two module- level variables
Dim I As Integer = 0' the index I can use to work with this array
Private Sub btnCalculate_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnCalculate.Click
[Code] .....
View 3 Replies
Nov 19, 2011
Trying to fill listboxes from a .txt file, but I only get 1 line. How do I loop the stream reader until the Field(0) changes. My txt file looks like this: [code] The number goes into a combobox, the name into a label, and the rest into listboxes, so I I need all the Gross Pay for person 100 in a list box.I have a module that reads the file into an array PayRolls (), And so far this is my code for the combobox. [code]
View 1 Replies
Nov 27, 2008
Define a structure named product, The structure should contain 2 variables one as a string and the other as a decimal. The decimal is used to store the price and the string is used to store the item number.
Declare a module level array that contains 5 product structure variables
Code the main forms load event procedure so that it reads the item number and prices from the itemInfo.txt file The procedure should store the item numbers and prices in the module level array. It also should add the item numbers to the list box.
When the user selects an item in the list box the items price should appear in the xPriceLabel. code the appropriate procedure.
The code I have is as follows
' Project name: Glovers Project
' Project purpose: The project displays the price of an item.
' Created/revised: <your name> on <current date>
[Code].....
Seems the problem I am having is this line is returning a value less than 0.
itemprice = (itemnumber.Substring(productIndex, newLineIndex - productIndex))
View 4 Replies
Feb 22, 2012
I've got this code
Public Class Form1
Dim m_listener As HttpListener = Nothing
Dim m_asyncCount As Integer = 0
[code].....
View 8 Replies
Feb 6, 2012
trying to figure out how to declare items here. here is the
[Code]...
View 2 Replies
Dec 10, 2009
Is it at all possible to declare variables dynamically? Something like Dim Answers & i As ArrayList. What I'm trying to achieve is putting one or more answers to a question into an array. Or should I really be looking at a mult-dimensional array to store the question number and answer? How would I add to and access a multi-dimentional array? Anyway, here's the section of code:[code].......
View 4 Replies
Aug 20, 2009
I'm new to VB.NET programming.What I'm confused about is the different ways one can declare a variable.Would someone please explain the difference between the two declarations below? [code]
View 2 Replies
Aug 16, 2010
How I can declare global variables in vb.net that I can access them in all windows of my application?
View 5 Replies
Jun 8, 2011
I am needing help in understanding how to declare variables properly. I am needing to write as program that calculates the commission for a sales person. I keep getting a error listed below. I thought I declared the salestextbox, costtextbox as integers correctly to use them in the calculation. I Copied my code below also. I have reread the chapter again and I am still lose.[code]
View 3 Replies
Dec 29, 2009
What happens if I do: Dim x As New Int32? Is a object of int placed on the heap? If it is, maybe your application would be able to access global variables faster if they were reference types.
A global variable as an value type should be somewhere at the bottom of the stack most of the time and it might take more time to get to this then to get a object from the heap. Unless it's the same story with the pointer of this object is also at the bottom of the stack of course.
View 9 Replies
Feb 13, 2012
I am making a game that involves moving picture boxes automaticly i can get the boxes moving but I need them to be object orientated but when I try to make it a class i am not to sure how to declare the veriables to make it work. [code]
View 3 Replies
Feb 12, 2010
This is a VB.Net newbie question. I'm confused at the different ways to declare and define variables.Here's an example:
Dim URL As String = http://www.c-sharpcorner.com/default.asp
Dim request As HttpWebRequest = WebRequest.Create(URL)
Dim response As HttpWebResponse = request.GetResponse()
[code]......
View 1 Replies
Nov 29, 2011
I put "isolated context" in quotes because I don't know what else you would call it. Basically, in C#, you can do this:
{ int i = 0; }
{ int i = 1; }
The curly braces create an isolated context which allows you to declare two variables with the same name in the same method or property logic. Is this possible in VB.NET? Also, what do you call this aside from an isolated context?
View 1 Replies
Oct 21, 2011
At the head of a module, I wish to declare some global variables for use in various subs/functions.
What is the difference between.Dim x as string and Private x as string / Public x as string, and when would I use one over the other?
View 1 Replies
Apr 29, 2012
When and why do you declare variables in the Public Class Form1 section?
View 1 Replies
Feb 16, 2010
How do one create System Level environmental variables manually. I just installed a GeoSupport Desktop Edition software and in the document it is mentioned that I need to create system-level environmental
variables for PATH and GEOFILES manually
Add the location of the GDE executables to the system-level environmental variable PATH.Normally this means adding C:Program FilesGeosupport Desktop Editionin to the PATH.
View 1 Replies
Jan 17, 2011
I have a variable declared at Public on a form. But when I try to access it in a module I get an error that its not declared.
[code]...
View 15 Replies
Mar 7, 2011
I declare a variable as FRIEND in a Module. Then I instantiate that variable in a Sub in the Module. After the Sub runs, when I try to access that Variable, it is always NULL (Nothing).
Module MODULE_Main
Friend MyClass1 As Class1
Friend Sub Main()
[code]....
How do I get MyClass1 to persist, meaning how do I get access to that variable outside of the Sub that instantiates it?
View 5 Replies
Jan 13, 2011
I'd like to get a more refined programming style and I was wondering if any of you might give me a hand...(How to declare public variables, constants, functions...in a proper way),is there any useful link or pdf document I could have a look in order to improve my style?
View 5 Replies
Apr 18, 2011
I am taking an online class and I am having trouble getting my solution to work. My assignment is as follows: In the function, declare variables for the average score and the letter grade. Calculate the average, use If/ElseIf statements to determine the letter grade, and return the letter grade.
Create a subprocedure for the Click event for the btnDisplay button. It should call the CalculateGrade function with three arguments (the three test scores from the text boxes), and display the returned value in the lblGrade box.I have looked all over the internet and have had no luck finding an example to look at I am taking an online class and I am having trouble getting my solution to work. My assignment is as follows:
In the function, declare variables for the average score and the letter grade. Calculate the average, use If/ElseIf statements to determine the letter grade, and return the letter grade.
[Code]...
View 7 Replies
Feb 11, 2009
I am new to the forum and new to the visual studio set up and have been working at a practical at home and have ran into some difficulty. The notes say that I am to declare several module variables below the section entitledI have the rest of the form complete but have been unable to locate where I am to place this code
View 1 Replies