|
-
Jun 21st, 2000, 06:34 PM
#1
Thread Starter
New Member
Can someone help me by replying this msg about how to open a new window from a button in a form ?
I want to open a new form from the existing form i have created from the button of the existing form.
If I use the method of MDIForm, the form will be created inside the existing form.
I want the new form to be loaded not inside the existing form.
pls..... someone help me ?
-
Jun 21st, 2000, 06:39 PM
#2
Fanatic Member
Something like this.
Code:
Private Sub command1_click()
'myNewForm is the form that you wish to show.
myNewForm.Show
End Sub
Iain, thats with an i by the way!
-
Jun 21st, 2000, 06:49 PM
#3
Thread Starter
New Member
THANX
thx lain
-
Jun 21st, 2000, 06:57 PM
#4
_______
...to make it on the fly
Private Sub Command1_Click()
Dim newform As Object
Set newform = New Form1
newform.left = 400
newform.Top = 2000
newform.Visible = True
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 21st, 2000, 06:59 PM
#5
Fanatic Member
Shouldn't you Dim it as a Form ??
Iain, thats with an i by the way!
-
Jun 21st, 2000, 07:25 PM
#6
_______
?
yes I suppose so, but object works as well..is there
a difference?
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 21st, 2000, 07:33 PM
#7
Fanatic Member
Yep.
1. Dim an object as the correct type, in this case a form, and you will be able to see all of the correct properites and methods with VB's type ahead thingy.
2. If you dim a variable as an object, you get late binding. If you dim it as the correct type, you will get early binding, which is a lot quicker.
Iain, thats with an i by the way!
-
Jun 21st, 2000, 07:54 PM
#8
_______
Ok
..thank you...
I'll adjust my notes......
I'll adjust my thoughts...
very good explanation.....
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 21st, 2000, 08:47 PM
#9
Addicted Member
When dimensioning as Form versus Object, are not also allocating memory correctly from the start ? Therefore saving memory space and probably execution speed...
A little like declaring a variable as Double versus Variant. The compiler knows immediately how much memory to reserve.
Is that right ?
-
Jun 21st, 2000, 08:57 PM
#10
Fanatic Member
No. Not with objects. You are right about variant versus othere types, but objects are diferent.
A Variable that is defined as an object is not actaully the object itself. It is just a 32 bit pointer to the object. As is a variable declared as a form. It is not the form, it is just a pointer to where the form is in memory.
Iain, thats with an i by the way!
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
|