Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dockable Windows

Status
Not open for further replies.

Magedi

MIS
Nov 20, 1998
1
ZA
How can one make a window to be docked on the either sides (left,top,bottom and right) of the screen without using 3rd party controls?.<br>
<br>
Magedi
 
Try this out. I'm not sure if it's the tidiest way of doing things but it works.

You need to add the code within a timer event.

Private Sub Timer1_Timer()
If Me.Top < 240 Then
Me.Top = 0
End If

If Me.Left < 240 Then
Me.Left = 0
ElseIf Me.Left + Me.Width > Screen.Width - 240 Then
Me.Left = Screen.Width - Me.Width
End If
End sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top