|
-
Jan 5th, 2000, 03:32 AM
#1
Thread Starter
Hyperactive Member
I have a form with a command button which makes another form pop up:
Private Sub Command1_Click()
Form2.Show
End Sub
Form1 is four times the size of form2. How can I have it so that form2 appears exactly in the bottom right hand corner of form1 - it takes up exactly a quarter of its space?
Thanks for any help!
-
Jan 5th, 2000, 04:07 AM
#2
Code:
Private Sub Command1_Click()
Form2.Move Form1.Width / 2 + Form1.Left, Form1.Height / 2 + Form1.Top
'Bottom Right hand corner
Form2.Move Form1.Left, Form1.Top
'Top Left Hand Corner
Form2.Move Form1.Width / 2 + Form1.Left, Form1.Top
'Top right hand corner
Form2.Move Form1.Left, Form1.Height / 2 + Form1.Top
'Bottom Left hand Corner
Form2.Width = Form1.Width / 2
Form2.Height = Form1.Height / 2
Form2.Show
End Sub
------------------
Boothman
There is a war out there and it is about who controls the information, it's all about the information.
[This message has been edited by Boothman_7 (edited 01-05-2000).]
[This message has been edited by Boothman_7 (edited 01-05-2000).]
-
Jan 5th, 2000, 04:21 AM
#3
You can use the above code to position the form. But bare in mind that if your form is not loaded yet, then you would have to load it first, ie:
Code:
Private Sub Command1_Click()
Load Form2
Form2.Move Form1.Width / 2 + Form1.Left, Form1.Height / 2 + Form1.Top
'Bottom Right hand corner
Form2.Move Form1.Left, Form1.Top
'Top Left Hand Corner
Form2.Move Form1.Width / 2 + Form1.Left, Form1.Top
'Top right hand corner
Form2.Move Form1.Left, Form1.Height / 2 + Form1.Top
'Bottom Left hand Corner
Form2.Width = Form1.Width / 2
Form2.Height = Form1.Height / 2
Form2.Show
End Sub
------------------
Serge
Software Developer
[email protected]
ICQ#: 51055819
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
|