On Feb 28, 2008, at 3:41 PM, Stephen Dodd wrote:
> Anyone have/know of a good cross-platform class to keep a window on
> screen that works well across multiple monitors?
Here's some code that could possibly be modified for multiple
screens. It's in the MouseDrag event of a window for screen(0) as is.
Sub MouseDrag(X As Integer, Y As Integer)
// Drag Window
Left = Left + (x - FirstX)
Top = Top + (y - FirstY)
// Keep Window onscreen
If Top<Screen(0).AvailableTop+2 Then Top=Screen(0).AvailableTop+2
If Left<Screen(0).AvailableLeft Then Left=Screen(0).AvailableLeft+2
If (Top+Height)>Screen(0).AvailableHeight Then Top=Screen
(0).AvailableHeight-Height+10
If (Left+Width)>Screen(0).AvailableWidth Then Left=Screen
(0).AvailableWidth-Width-2
End Sub
Terry
PS. I intended to make it for multiple screens but I never had any. :)
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|