Results 1 to 9 of 9

Thread: Bot. Right corner?

  1. #1

    Thread Starter
    Lively Member Scorpion965's Avatar
    Join Date
    Jan 2002
    Location
    Laguna Hills, CA
    Posts
    100

    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...

  2. #2
    Lively Member
    Join Date
    Jan 2002
    Posts
    76

    API

    I Smell API Calls, but I don't personally know which ones (Yet).

    **Bump**

  3. #3
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    this will move it to the bottom right of the screen. not sure about the task bar part though

    VB Code:
    1. Private Sub Form_Load()
    2.     Me.Left = Screen.Width - Me.Width
    3.     Me.Top = Screen.Height - Me.Height
    4. End Sub
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  4. #4
    Lively Member
    Join Date
    Jan 2002
    Posts
    76

    Wiping Pie

    Damn that was too easy....The only problem is the Task Bar Height.

  5. #5
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828

    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...
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Here is how to get the position of the task bar.
    VB Code:
    1. Private Declare Function AppBarMessage Lib "shell32.dll" Alias "SHAppBarMessage" (ByVal dwMessage As Long, pData As APPBARDATA) As Long
    2.  
    3. Private Type RECT
    4. Left As Long
    5. Top As Long
    6. Right As Long
    7. Bottom As Long
    8. End Type
    9.  
    10. Private Type APPBARDATA
    11. cbSize As Long
    12. hwnd As Long
    13. uCallbackMessage As Long
    14. uEdge As Long
    15. rc As RECT
    16. lParam As Long ' message specific
    17. End Type
    18.  
    19. Private BarData As APPBARDATA
    20. Private MyPos As String
    21.  
    22. Private Const ABM_GETTASKBARPOS As Long = &H5&
    23.  
    24. Private Sub GetTaskBarPos()
    25.  
    26. Dim WhereAmI As Long
    27. BarData.cbSize = Len(BarData)
    28. WhereAmI = AppBarMessage(ABM_GETTASKBARPOS, BarData)
    29.  
    30. MyPos = "Top = " & BarData.rc.Top & vbCrLf 'contains top most position
    31. MyPos = MyPos & "Bottom = " & BarData.rc.Bottom & vbCrLf 'contains bottom most position
    32. MyPos = MyPos & "Left = " & BarData.rc.Left & vbCrLf 'contains far left position
    33. MyPos = MyPos & "Right = " & BarData.rc.Right & vbCrLf 'contains far right position
    34. MsgBox MyPos
    35. End Sug

  7. #7
    Lively Member
    Join Date
    Jan 2002
    Posts
    76

    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

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    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.

  9. #9
    Staifour
    Guest
    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
  •  



Click Here to Expand Forum to Full Width