|
-
Nov 22nd, 2000, 04:08 AM
#1
Thread Starter
Fanatic Member
Hi all,
could you please someone help me out here, this IS simple, just an object definition that I cannot find.
I've got an MDI form, in which a button creates new forms with this code:
Code:
Dim frmA As Main
Set FrmA As New Main
FrmA.Show
Main is the name of a template form that I use to create all the forms within the MDI.
Now, how can I retrieve the Height property of one of these child forms? I need the object name, i.e. if I need the height of Main I use Main.Height, but in this case what can I use? FrmA.Height within a code doesn't work. I believe something as Parent.Height should exist, if someone knows the right expression 
Thank you very much in advance,
W.
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
-
Nov 22nd, 2000, 10:14 AM
#2
You have your variable setup wrong. If you want to create an instance of the form with Set statement, the you should do something like this:
Set frmA = New Main
Since you have an object variable that represents your form, you can treat it just like a regular form.
Code:
Dim frmA As New Main
frmA.Show
MsgBox frmA.Height
-
Nov 22nd, 2000, 11:04 AM
#3
Thread Starter
Fanatic Member
No ok my variable is correct, just the code that I typed here was wrong 
Thanks for your answer, but the problem still remains, as it is NOT when I create the new form that I need to know the height, but at a further moment by clicking on a button on the form itself.
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
-
Nov 22nd, 2000, 11:15 AM
#4
On the button's click event you can do something like this:
Code:
Private Sub Command1_Click()
MsgBox Me.Height
End Sub
This should work regardless how many instances of your form you have created.
-
Nov 22nd, 2000, 11:24 AM
#5
Thread Starter
Fanatic Member
... I thought that too!
Yes, that was the first thing that I did try... but it didn't work I'm sorry I can't recall what the problem was, anyway Me was not interpreted as a valid object, who knows why...
Thanks for all your replies, I hope you have other suggestions!
Best regards,
W.
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
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
|