|
-
Mar 11th, 2004, 09:42 AM
#1
Thread Starter
Supreme User
Make form center on screen? [RESOLVED]
And i dont mean when it starts up.
VB Code:
Private Sub mnuViewFileEditorMode_Click()
'Size window according to users preference
If mnuViewFileEditorMode.Checked = True Then
mnuViewFileEditorMode.Checked = False
Me.Width = 5730
ElseIf mnuViewFileEditorMode.Checked = False Then
mnuViewFileEditorMode.Checked = True
Me.Width = 11520
End If
End Sub
This sizes my form when the menu is clicked, the problem is, sometimes my form is left right at the far left off the screen.
Is there any way to make it go to the center?
Thanks
Last edited by Madboy; Mar 11th, 2004 at 09:52 AM.
-
Mar 11th, 2004, 09:46 AM
#2
Fanatic Member
Try this...
VB Code:
Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
-
Mar 11th, 2004, 09:49 AM
#3
Thread Starter
Supreme User
Gr8 M8
But, i only want it centering for when the form is made small. If it isnt then just position as it does normally when my form first starts up:
VB Code:
Private Sub mnuViewFileEditorMode_Click()
'Size window according to users preference
If mnuViewFileEditorMode.Checked = True Then
mnuViewFileEditorMode.Checked = False
Me.Width = 5730
Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
ElseIf mnuViewFileEditorMode.Checked = False Then
mnuViewFileEditorMode.Checked = True
Me.Width = 11520
End If
End Sub
-
Mar 11th, 2004, 09:51 AM
#4
Thread Starter
Supreme User
DOH! fixed, needed to add the code again under Elseif
Thanks mate
-
Nov 14th, 2010, 10:50 PM
#5
Lively Member
Re: Make form center on screen? [RESOLVED]
 Originally Posted by demotivater
Try this...
VB Code:
Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
thanks bro
-
Nov 15th, 2010, 01:25 AM
#6
Re: Make form center on screen? [RESOLVED]
Please don't bump old threads (like this one that has been dead for almost 7 years). If you want to show appreciation to someone that help, you can use the rating system, next to every post on the left beneath user info there is a "Rate this post" link which you can use to thank someone and add points to their reputation.
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
|