请教各位高手:vb6的控件的问题。谢谢。
在用一些软件时,象标签或文本框,此控件的底色是灰色的,当鼠标的右键单击它时,会显示一列数据。请教各位高手:vb6好像无此控件是吗?
[此贴子已经被作者于2016-3-29 22:14编辑过]
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long Private Type POINTAPI X As Long Y As Long End Type Dim p As POINTAPI Dim ss As Double Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 2 Then LabelToolTipText.Visible = True GetCursorPos p LabelToolTipText.Left = p.X + Label1.Left LabelToolTipText.Top = p.Y + Label1.Top LabelToolTipText.Caption = Label1.ToolTipText '或者写其他的内容 End If End Sub Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 2 Then LabelToolTipText.Visible = False End If End Sub