Windows Phone Developers

Tuesday, October 30, 2007

Public Variables in VB.Net

Declaring Public Variables in Visual Studio .Net

Last week when I had a chat with Sharmila Purushotaman, she told that one of the frequent query she gets is about the scope of the variables. She wanted me to share the information (and gave the following hint too). Here we go:

Application Name : Sample

Create a separate module as PublicVariables.VB (This is a Module)

Create a frmSample.vb (This is a form)

In the beginning of frmSample(Code Module) include this statement.

Imports Sample.PublicVariables (Before the statement Public Class frmSample)

All thats needed was to create a separate module (though not mandatory ... it would be a best practice to do so) and declare the variables and use the Imports statement to use the variable in the subsequent classes or modules Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment