
04-29-2005, 11:21 PM
|
|
Enthusiast
Retired Leader * Expert *
|
|
Join Date: Apr 2002
Location: Bellevue, WA.
Posts: 3,233
|
|
Use the form's .ScaleWidth and .ScaleHeight properties when calculating the position of the controls. Size the picture box by subtracting the height of the status bar from the form's .ScaleHeight and move it to the top of the form. The width can remain the same size as the form's .ScaleWidth if it is to take the full width of the form.
Do the moving in the Form Resize event. Note that controls can not be moved when a form is minimized so deal with that in your code. Something like this...
Code:
Private Sub Form_Resize()
'Only move controls if form is visible.
If Me.WindowState <> vbMinimized Then
'Status Bar.
StatusBar.Move Me.ScaleLeft, Me.ScaleHeight - StatusBar.Height, Me.ScaleWidth
'Picture Box.
Picture1.Move Me.ScaleLeft, Me.ScaleTop, Me.ScaleWidth, Me.ScaleHeight - StatusBar.Height
End If
End Sub
|
|