Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

Multiple Forms and Propertys

$
0
0
Hey,

I am currently sitting at 5 Different forms: One for login, selection, new order and the main form.

Now, the information entered into login form and new order form need to be accessed in the main form. What I am doing right now is adding an overload to the new function, so in my Main Form I have this

vb.net Code:
  1. Public Sub New(filepath As String)
  2.  
  3.         ' This call is required by the designer.
  4.         InitializeComponent()
  5.  
  6.         ' Add any initialization after the InitializeComponent() call.
  7.         xmlpath = filepath
  8.  
  9.  
  10.     End Sub

and it is called like this

vb.net Code:
  1. Dim operation As New Form1(path)

If I wanted to use properties instead, how would I go about that?

Should I create a new class with public property's in it? So when the Login is loaded a new instance of that class is created?

or should I create public property within the forms it self, so I would have a public property 'Name' in my login form, and access it via login.Name

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>