If Err <> 0 Then Exit Function 'if no form is active then exit
For cntr = 0 To FM.Count - 1 'loop throgh controls on form
Set CL = FM(cntr)
If CL.InSelection = True Then 'if control is selected then add info
CL.Tag = InputBox("Enter the tool tip", CL.Name)
On Error Resume Next
CL.OnMouseMove = "[Event Procedure]"
On Error Resume Next
FM.Module.InsertText "Sub " & CL.Name & "_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)" & CRLF & "ShowEventToolTip Me." & CL.Name & ", X, Y" & CRLF & "End Sub"
End If
Next
If MsgBox("Insert show procedure and TT control ?", MB_ICONQUESTION + MB_YESNO + MB_DEFBUTTON2, "Tool Tip Inserter") = IDYES Then
Dim TTProc$
Dim TTCtl As Control
Set TTCtl = CreateControl(FM.Name, 100, 0, 0, "ToolTip")
TTCtl.Name = "ToolTip"
TTCtl.BackColor = 8454143
TTCtl.Visible = False
TTCtl.BorderStyle = 1
TTCtl.BorderColor = 0
TTCtl.FontName = "MS Sans Serif"
TTCtl.FontWeight = 8
TTCtl.SpecialEffect = 0
FM.Module.InsertText "Sub ToolTip_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)" & CRLF & "Me.ToolTip.Visible = False" & CRLF & "End Sub"
FM.Module.InsertText "Sub Detail0_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)" & CRLF & "Me.ToolTip.Visible = False" & CRLF & "End Sub"
TTCtl.OnMouseMove = "[Event Procedure]"
FM.Section(0).OnMouseMove = "[Event Procedure]"
TTProc$ = TTProc$ & "Sub ShowEventToolTip (frmCtl As Control, mseX As Single, mseY As Single)" & CRLF