|
-
Feb 28th, 2002, 11:12 AM
#1
Thread Starter
Lively Member
Bot. Right corner?
How do I set my program to run in the bottom right corner (above the clock, etc.) regardless of the user's screen resolution? I want my form to have its bot. right corner in the screen's bot. right corner...
-
Feb 28th, 2002, 11:15 AM
#2
Lively Member
API
I Smell API Calls, but I don't personally know which ones (Yet).
**Bump**
-
Feb 28th, 2002, 11:17 AM
#3
Bouncy Member
this will move it to the bottom right of the screen. not sure about the task bar part though
VB Code:
Private Sub Form_Load()
Me.Left = Screen.Width - Me.Width
Me.Top = Screen.Height - Me.Height
End Sub
-
Feb 28th, 2002, 11:21 AM
#4
Lively Member
Wiping Pie
Damn that was too easy....The only problem is the Task Bar Height.
-
Feb 28th, 2002, 11:30 AM
#5
Bouncy Member
Re: Wiping Pie
Originally posted by mbeverley
Damn that was too easy....The only problem is the Task Bar Height.
well the taskbar height most like involves the API (as said) or retrieving a value from the registry...
-
Feb 28th, 2002, 12:31 PM
#6
Here is how to get the position of the task bar.
VB Code:
Private Declare Function AppBarMessage Lib "shell32.dll" Alias "SHAppBarMessage" (ByVal dwMessage As Long, pData As APPBARDATA) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type APPBARDATA
cbSize As Long
hwnd As Long
uCallbackMessage As Long
uEdge As Long
rc As RECT
lParam As Long ' message specific
End Type
Private BarData As APPBARDATA
Private MyPos As String
Private Const ABM_GETTASKBARPOS As Long = &H5&
Private Sub GetTaskBarPos()
Dim WhereAmI As Long
BarData.cbSize = Len(BarData)
WhereAmI = AppBarMessage(ABM_GETTASKBARPOS, BarData)
MyPos = "Top = " & BarData.rc.Top & vbCrLf 'contains top most position
MyPos = MyPos & "Bottom = " & BarData.rc.Bottom & vbCrLf 'contains bottom most position
MyPos = MyPos & "Left = " & BarData.rc.Left & vbCrLf 'contains far left position
MyPos = MyPos & "Right = " & BarData.rc.Right & vbCrLf 'contains far right position
MsgBox MyPos
End Sug
-
Feb 28th, 2002, 12:38 PM
#7
Lively Member
Thanks
Hack Dude,
This wasn't even my original post, but I appreciate the code. You can bet I put that in my code library.
Michael
-
Feb 28th, 2002, 12:43 PM
#8
I figured it would come in handy if Scorpion965 was going to try and calculate what the bottom, right, of his screen would be, taking into consideration the position of the task bar.
-
Feb 28th, 2002, 12:53 PM
#9
i think that expert programmers like code more then objects
but beginners like objects more, so if you don't want to think about all this code, you can get the taskbar's height using a control called SysInfo
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
|