Load(form)

Pulsar

New member
Joined
Jun 24, 2008
Messages
2
Programming Experience
1-3
Hello,

Lately a mate of mine & I have been recoding a DeskTop application from VB6 to VB.NET, we are stuck on a slight problem

In VB6 you could use Load(Form1) for example to load that form into memory and interact with its controls without showing the form to the user

In VB.NET it appears the function of this is different? Does anyone around here know how to do this?
Any help would be much appreciated..

Thank you.
 
Like with all type classes you declare a variable and create a new instance which you assign to it. For example if your class is called Form1 do this: Dim f As New Form1, this is short for the declaring the variable and type Dim f As Form1 and the assignment of the new instance = New Form1. Now the f variable hold the new instance of type Form1 and you can interact with it before you Show it.

Nearly forgot to mention this simple feature; there are also default instances of the forms classes in your project, when you only need one instance of the form you can access it by just using the name without creating a new and referencing with variable, for example Form1.Text = "hello default", Form1.Show()
 
Hello again

Thank you for your reply JohnH, this worked great i was able to call our function as needed.

However, We have run into another problem that you or someone else may be able to assist with

We basically have two forms (frmMain and frmAuth) on which frmMain the user enters a user and password which is then used to connect to an IRC server. The IRC socket is defined within frmAuth. On recieving a certain 'RAW' from the IRC server (005 to be exact) we close frmMain using ( frmMain.close() ) and show frmAuth using ( me.show() )- however at this point frmAuth freezes and becomes unresponsive, which leads to the program being ended, While mentioning this the we can have frmAuth show upon clicking `Login` and this works fine, this problem is highly pretty damn annoying..

Thanks for your Help..
 
Back
Top