|
-
Aug 3rd, 2002, 10:14 AM
#1
Thread Starter
yay gay
How to load a form without showing it?
i already tryed
VB Code:
Frm.Show
Frm.Visible = False
and it shows the form in half a sec and then hides it...
already tryed too:
VB Code:
Frm.Visible = False
Frm.Show
didnt work too...
in VB6 i could use the load(frm) but now it requires a second argument, and i dont know what is it...any help or ideas?
-
Aug 3rd, 2002, 11:48 AM
#2
Frenzied Member
Do it in the constructor or set design time visible property to false.
-
Aug 3rd, 2002, 02:08 PM
#3
Hyperactive Member
Dim frm as New Form1
Just like with any other object, this will cause a new instance of Form1 to be loaded.
-
Aug 3rd, 2002, 02:41 PM
#4
Thread Starter
yay gay
-
Aug 3rd, 2002, 03:47 PM
#5
Thread Starter
yay gay
-
Aug 3rd, 2002, 05:42 PM
#6
Hyperactive Member
Originally posted by PT Exorcist
it is PUBLIC...
????
So what? You can create new instances of public classes with the way I've mentioned.
-
Aug 3rd, 2002, 07:23 PM
#7
-
Aug 3rd, 2002, 07:45 PM
#8
PowerPoster
What is wrong with this:
Dim frmTemp As Form1
Set frmTemp = New Form1()
It loads an instance of the form, but doesn't show it...
Maybe I am not understanding the problem though...
-
Aug 3rd, 2002, 07:51 PM
#9
Originally posted by hellswraith
What is wrong with this:
Dim frmTemp As Form1
Set frmTemp = New Form1()
It loads an instance of the form, but doesn't show it...
Maybe I am not understanding the problem though...
I guess it works 
Umm there is only one thing that I dont understand... when you do this Form_Load event wont fire. It doesnt make sense
-
Aug 3rd, 2002, 09:23 PM
#10
Whatever you want to fire can just go in the New() method instead of in the Form_Load.
-
Aug 5th, 2002, 01:02 PM
#11
New Member
Load frmMyForm
In VB 6 it is ...
Load frmMyForm
Is the Unload and Load commands gone in VB.NET?
-
Aug 5th, 2002, 01:29 PM
#12
Umm you dont load a class with a load statement, so I guess it's useless becuase most of the stuff are treated as classes
-
Aug 5th, 2002, 03:10 PM
#13
No instead of Load you use the objects constructor which is some form of New() method. The Form_Load event only fires when the form is becoming visible (as far as I can tell) kind of like a one time Activated event. But any code in the constructor called to make the object runs when it is called.
VB Code:
'in the class
Public Sub New()
MyBase.New()
Msgbox ("Shhh I'm loading")
End Sub
'Or if it is a form we are talking about
Public Sub New()'is in the region at the top
'just skip past all the creation of the controls and that jazz
Msgbox ("Shh I'm loading and a Form")
End SUb
'in app
dim obj as New Object1 'will fire the msgbox here
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|