Hey fellas,
Is there any method by which I can declare a Variable that can be used in multiple forms in VB.NET ?
Rahul47
Recommended Answers
Jump to PostDeclare the variable with the
Public
keywaord in the top most class of your form, i.e.Public Class Form1 Public MyVariable As String = "Test String" Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Do stuff End Sub End Class
Access …
Jump to PostPublic Module Module_Global_Variables Friend Global_Emp_CD As String Friend Global_User_Type As String End Module Now you can use Variables as normal variables
All 6 Replies
tinstaafl
1,176
Posting Maven
Rahul47
tinstaafl
1,176
Posting Maven
TnTinMN
418
Practically a Master Poster
sushil_kataria
3
Newbie Poster
Maligui
commented:
This is how I would do it. Good Post.
+3
Rahul47
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.