Microsoft
Software
Hardware
Network
Question : Center Form on Window when Maximized
I am trying to mimic a stand alone application by using a miximized pop-up form.
The only things on this form are a Tab Control (in Detail) and Button Control (Quit Button in Footer).
I want to maximise the pop-up form on the screen and center as aligned left looks silly.
Here is waht I have tried so far:
Controls:
Tab Control Name = TabCtl
Button Name = QuitButton
**************************
**********
**********
**
Private Sub Form_Load()
Dim intWidth As Integer
Dim intHeight As Integer
Dim intTabWidth As Integer
Dim strFormName As String
Dim intLeft As Integer
'Maximise window
DoCmd.Maximize
'Get current width parameters
intWidth = Me.WindowWidth
intTabWidth = Me.TabCtl.Width
'Get new left position
intLeft = ((intWidth - intTabWidth) / 2)
'Change width of form
Me.Width = Me.Width + intLeft
'Move Tab Control
Me.TabCtl.Move intLeft
End Sub
**************************
**********
**********
**
All this seems to do is extend the width of the Tab Control.
Can anyone tell me why this doesn't work and how I can achieve what I'm trying to do?
Thanks in advance.
Answer : Center Form on Window when Maximized
I tried your code on a very basic form containing a single tab control, and it appears to work as one would expect.
Random Solutions
Stop comments from printing in Word 2007
Computer Description Permission of Domain user
Is there a way to have excel notify you of a change made on a particular spreadsheet?
Read matching files in a folder, read one of them and insert the Data in a Table
WHAT IS AN ILIST,IDATASOURCE,IENUMERA<wbr />BLE
access sub-form with While...Wend to update main form
Why does my text box have <div> ...... <div> tags?
How to convert this VB.NET code to VC# code?
Messenger connection error 80072f0d
Using Batch file to Obtain the Computernames, usernames, IP Address and MAC Address from each remote PCs