Show title bar on hover in VB6

Viewed 140

How can I show the title bar of a form only if the mouse is at the top of the form like on Windows Media Player 9? I already implemented this but it is awkward and the controls/elements and the window moves down a little if I use my code while WMP 9/10's window stays at the current position.

Private Sub Timer1_Timer()
    Dim pos as coord  'my type, has x as long and y as long
    GetCursorPos pos
    If pos.y * 15 > Me.Top - 500 And pos.y * 15 < Me.Top + 300 And pos.x * 15 > Me.Left And pos.x * 15 < Me.Left + Me.Width Then
        Me.BorderStyle = 2
        Me.Caption = Me.Caption
    Else
        Me.BorderStyle = 0
        Me.Caption = Me.Caption
    End If
End Sub
0 Answers
Related