Visual Basic 6.0 ToolTipText多行

时间:2017-07-08 10:25:03

标签: loops vb6

我需要有关如何为此函数执行循环的帮助。我从http://www.vbcode.com/Asp/showsn.asp?theID=6906获取此编码。

我的问题是,我想为6个不同的图像做多行tooltiptext,使用for..next循环可以简化所有这些吗?

感谢。

'A Multi-Line ToolTip Example
'
'by: Christopher D. Manns


Public Function MrToolTip(MyControl As Control, MyString As String)

   TxtToolTip.Visible = True

   If MyControl.Left + MyControl.Width + TxtToolTip.Width < Me.Width - MyControl.Left + TxtToolTip.Width Then
      TxtToolTip.Move MyControl.Left + MyControl.Width, MyControl.Top
   Else
      TxtToolTip.Move MyControl.Left - TxtToolTip.Width, MyControl.Top
   End If
   TxtToolTip.Text = MyString

End Function

Private Function MrToolTipReset()
'Hide the tool tip text box.

   TxtToolTip.Visible = False
   TxtToolTip.Text = ""

End Function
'------ Everything below an Example Using MrToolTip -------

Private Sub imgIsland_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'An Example of how to call MrToolTip, you can call MrToolTip from
'MouseMove Event of any control.

   MrToolTip imgIsland, "This is an example of " & _
   "MrToolTip. Can't beat a Multi-Line Tool Tip"

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Unless you want a tooltip for the form, clear it and hide.
   MrToolTipReset
End Sub
Private Sub TxtToolTip_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'User has moved from active control.
  MrToolTipReset
End Sub

0 个答案:

没有答案