Click here to Skip to main content
15,897,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: from debuging in c# Pin
N a v a n e e t h27-Sep-09 1:42
N a v a n e e t h27-Sep-09 1:42 
AnswerRe: from debuging in c# Pin
dan!sh 27-Sep-09 9:21
professional dan!sh 27-Sep-09 9:21 
AnswerRe: from debuging in c# Pin
Christian Graus27-Sep-09 12:09
protectorChristian Graus27-Sep-09 12:09 
QuestionGlobal Variables in VB.NET Pin
PAguilar0926-Sep-09 14:45
PAguilar0926-Sep-09 14:45 
AnswerRe: Global Variables in VB.NET Pin
Christian Graus26-Sep-09 14:58
protectorChristian Graus26-Sep-09 14:58 
GeneralRe: Global Variables in VB.NET Pin
PAguilar0926-Sep-09 15:16
PAguilar0926-Sep-09 15:16 
GeneralRe: Global Variables in VB.NET Pin
Christian Graus26-Sep-09 15:29
protectorChristian Graus26-Sep-09 15:29 
GeneralRe: Global Variables in VB.NET Pin
Dave Kreskowiak26-Sep-09 16:11
mveDave Kreskowiak26-Sep-09 16:11 
You really shouldn't be creating "global" variables in the first place. If you do, it's a sign that you may have a problem with your class structure and are violating encapsulation rules.
Public Class MyGlobals
    Shared Public someVar As Integer
End Class

And to get at it's value:
MyGlobals.someVar = 30

You would also be advised that it's better to wrap the variable in a Property to control access to the variable and do validation on any set attempts.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




AnswerRe: Global Variables in VB.NET Pin
darkelv26-Sep-09 20:24
darkelv26-Sep-09 20:24 
QuestionOverload an existing class Pin
cstrader23226-Sep-09 12:07
cstrader23226-Sep-09 12:07 
AnswerRe: Overload an existing class Pin
Christian Graus26-Sep-09 12:45
protectorChristian Graus26-Sep-09 12:45 
QuestionHow to invoke a dopostback in web browser control Pin
aib200526-Sep-09 8:48
aib200526-Sep-09 8:48 
Questionclick datagridview Row and display in textbox! Pin
jeshra27926-Sep-09 0:57
jeshra27926-Sep-09 0:57 
AnswerRe: click datagridview Row and display in textbox! Pin
dan!sh 26-Sep-09 5:51
professional dan!sh 26-Sep-09 5:51 
GeneralRe: click datagridview Row and display in textbox! Pin
jeshra27927-Sep-09 18:07
jeshra27927-Sep-09 18:07 
QuestionSQL Server Connection Issue VB 2008 [modified] Pin
RP10825-Sep-09 18:22
RP10825-Sep-09 18:22 
AnswerRe: SQL Server Connection Issue VB 2008 Pin
RP10826-Sep-09 4:20
RP10826-Sep-09 4:20 
QuestionHow can I export a datagrid to excel? Pin
waner michaud25-Sep-09 7:41
waner michaud25-Sep-09 7:41 
AnswerRe: How can I export a datagrid to excel? Pin
David Mujica25-Sep-09 8:17
David Mujica25-Sep-09 8:17 
GeneralRe: How can I export a datagrid to excel? Pin
waner michaud25-Sep-09 8:43
waner michaud25-Sep-09 8:43 
GeneralExcel Pin
David Mujica25-Sep-09 9:54
David Mujica25-Sep-09 9:54 
GeneralRe: Excel Pin
waner michaud28-Sep-09 3:20
waner michaud28-Sep-09 3:20 
AnswerRe: How can I export a datagrid to excel? Pin
Johan Hakkesteegt25-Sep-09 8:54
Johan Hakkesteegt25-Sep-09 8:54 
GeneralRe: How can I export a datagrid to excel? Pin
waner michaud25-Sep-09 10:52
waner michaud25-Sep-09 10:52 
Questiontodolist in vb.net Pin
mohsen3325-Sep-09 2:37
mohsen3325-Sep-09 2:37 

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.