ToolTipText personalizado

Started by Anonymous, 13 de May , 2007, 04:38:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Anonymous

ToolTipText personalizado


Este código transforma um formulário retangular em um quadrado

de cantos arredondados. Ponha um Label no formulário para

exibir o que você quiser, e no evento Deactivate do Form, ou

Click, MouseMove, ou qualquer outro, de um Unload no Form, para

ele sumir.

Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd

As _
        Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As

Long
Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal

X1 _
        As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2

As _
        Long, ByVal X3 As Long, ByVal Y3 As Long) As Long

Private Sub Form_Load()
  Dim RoundRect As Long
  Me.Move 0, 0
  RoundRect = CreateRoundRectRgn((Me.Left + 60) /

Screen.TwipsPerPixelX, _
              (Me.Top + 400) / Screen.TwipsPerPixelY, _
              (Me.Left + 2600) / Screen.TwipsPerPixelX, _
              (Me.Top + 1500) / Screen.TwipsPerPixelY, 20, 20)
  SetWindowRgn Me.hwnd, RoundRect, True
  Me.Move (Screen.Width - 2550) / 2, (Screen.Height - 1100) / 2
End Sub