HOWTO place always ontop form to same screen location like MS officeshortcut bar

  • Thread starter Thread starter Ty
  • Start date Start date
T

Ty

Hello all,
I would like to accomplish the same thing as the MS office shortcut
bar's "Auto fit into titlebar area".

The bar is placed at the top right side of the screen but to the left
of where the windows min, max , and close buttons would be.

Any thought would be appreciated.

Thanks,
Ty
 
This is how I solved my problem

Place in the form load event.

Dim strtemp As String
Dim intcount As Integer
Dim intlen As Integer
Dim stry As String
Dim strx As String
Dim intx As Integer
Dim inty As Integer

strtemp = ScreenResolution()

intcount = InStr(strtemp, "X")
intlen = Len(strtemp)

strx = Mid(strtemp, 1, intcount - 2)
stry = Mid(strtemp, intcount + 2, intlen - (intcount))

inty = CInt(stry)
intx = CInt(strx)

Me.Top = 0 'inty - 100
Me.Left = intx - 250

Place this on the code page.

Public Function ScreenResolution() As String
Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height
Return intX & " X " & intY
End Function

Ty
 
Back
Top