position right bottom corner

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zybernau
    New Member
    • Mar 2007
    • 34

    position right bottom corner

    Hi everyone,

    how to find the position of the right bottom corner of the screen
    [llike popups in yahoo messenger]
    [like google talk notifications, thunderbird mail notifications]

    i need to design a form and make it display in the right bottom corner , this should work even in various resolution
    800*600,1400*90 0,..


    Environment:
    .net frame work 2.0
    visual studio 2005


    Thanks,
    Rajamohan.M
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    This is for VB6, convert it to ur version of VB:
    Make Forms property :
    StartupPosition = Manual

    Write this code in FormLoad Event :

    [code=vb]
    Me.Left = (Screen.Width - Me.Width)
    Me.Top = (Screen.Height - Me.Height)
    [/code]

    Just take care of the Window's Task Bar's height..

    Regards
    Veena

    Comment

    • zybernau
      New Member
      • Mar 2007
      • 34

      #3
      tHanks , Veena.

      this works

      screen.PrimaryS creen.WorkingAr ea.Width

      screen.PrimaryS creen.WorkingAr ea.Height


      but the when i increased the taskbar its is not updating the height value

      is there any method to find the taskbar heights/ original work area in windows screen




      ??

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        This is again a VB6 code :
        There is no direct way to get the height/width of the Task Bor, U need to get the Work Area, and Minus it from the Total Screen Area using API's

        [code=vb]
        'Declare this on the top of the code window
        Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
        End Type

        Private Type TBarData
        cbSize As Long
        hwnd As Long
        uCallbackMessag e As Long
        uEdge As Long
        rc As RECT
        lParam As Long
        End Type

        Private Declare Function SHAppBarMessage Lib "shell32.dl l" (ByVal dwMessage As Long, pData As TBarData) As Long

        ' write this on command click:
        Private Sub Command2_Click( )
        Dim TBar As TBarData
        SHAppBarMessage &H5, TBar
        MsgBox "WINDOWS TASK BAR STATS:" & vbCrLf & "Width:" & TBar.rc.Right - TBar.rc.Left & " Height:" & TBar.rc.Bottom - TBar.rc.Top
        End Sub

        [/code]


        Regards
        Veena

        Comment

        Working...