Click here to Skip to main content
15,915,508 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: reading logfile Pin
Noctris18-Jun-08 0:14
Noctris18-Jun-08 0:14 
GeneralRe: reading logfile Pin
Ebube18-Jun-08 4:35
Ebube18-Jun-08 4:35 
GeneralRe: reading logfile Pin
Noctris18-Jun-08 6:02
Noctris18-Jun-08 6:02 
AnswerRe: reading logfile Pin
Hasan Jaffal18-Jun-08 20:05
Hasan Jaffal18-Jun-08 20:05 
QuestionAsking about global variable using VB.NET Window Form Application Pin
drexler_kk17-Jun-08 21:01
drexler_kk17-Jun-08 21:01 
AnswerRe: Asking about global variable using VB.NET Window Form Application Pin
Ashfield17-Jun-08 21:20
Ashfield17-Jun-08 21:20 
GeneralRe: Asking about global variable using VB.NET Window Form Application Pin
drexler_kk17-Jun-08 22:11
drexler_kk17-Jun-08 22:11 
AnswerRe: Asking about global variable using VB.NET Window Form Application Pin
Guffa17-Jun-08 21:34
Guffa17-Jun-08 21:34 
From version 7 (VB.NET 2003) VB is an object oriented language, which means that there are no longer any global variables. All variables are either members of a class or local in a method.

To set up variables that you can use like you did use global variables, you can use static variables. You use the Shared keyword to do this, and those variables are members of a class rather than members of an instance of the class.
Public Class UserDetails
   Public Shared UserId As String
   Public Shared UserName As String
   Public Shared UserPassword As String
End Class

You can access the variables from anywhere by specifying the class name and the variable name:

UserDetails.UserId = "42"

Despite everything, the person most likely to be fooling you next is yourself.

QuestionRe: Asking about global variable using VB.NET Window Form Application Pin
drexler_kk17-Jun-08 22:06
drexler_kk17-Jun-08 22:06 
AnswerRe: Asking about global variable using VB.NET Window Form Application Pin
Guffa17-Jun-08 22:21
Guffa17-Jun-08 22:21 
QuestionRe: Asking about global variable using VB.NET Window Form Application Pin
drexler_kk17-Jun-08 22:44
drexler_kk17-Jun-08 22:44 
AnswerRe: Asking about global variable using VB.NET Window Form Application Pin
Jay Royall18-Jun-08 1:34
Jay Royall18-Jun-08 1:34 
GeneralRe: Asking about global variable using VB.NET Window Form Application Pin
drexler_kk18-Jun-08 15:12
drexler_kk18-Jun-08 15:12 
GeneralRe: Asking about global variable using VB.NET Window Form Application Pin
drexler_kk18-Jun-08 15:15
drexler_kk18-Jun-08 15:15 
GeneralRe: Asking about global variable using VB.NET Window Form Application Pin
Guffa18-Jun-08 23:32
Guffa18-Jun-08 23:32 
Questiondebugging problem Pin
maytel mynt17-Jun-08 19:28
maytel mynt17-Jun-08 19:28 
AnswerRe: debugging problem Pin
Rupesh Kumar Swami17-Jun-08 21:48
Rupesh Kumar Swami17-Jun-08 21:48 
GeneralRe: debugging problem Pin
maytel mynt17-Jun-08 22:34
maytel mynt17-Jun-08 22:34 
Question(Rs232) how to receiver the correct value and sort in textbox Pin
kain77717-Jun-08 17:56
kain77717-Jun-08 17:56 
QuestionMutiple instance in app.config Pin
Subjugate17-Jun-08 15:41
Subjugate17-Jun-08 15:41 
QuestionSetting Focus inside a text box Pin
New_Coder17-Jun-08 15:25
New_Coder17-Jun-08 15:25 
AnswerRe: Setting Focus inside a text box Pin
jzonthemtn17-Jun-08 15:38
jzonthemtn17-Jun-08 15:38 
QuestionGraduation project Pin
salam ellayan17-Jun-08 10:45
salam ellayan17-Jun-08 10:45 
AnswerRe: Graduation project PinPopular
Christian Graus17-Jun-08 17:37
protectorChristian Graus17-Jun-08 17:37 
GeneralRe: Graduation project Pin
Mark Churchill17-Jun-08 18:38
Mark Churchill17-Jun-08 18:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.