Tooltip whit more than one text field?-VBForums
Results 1 to 2 of 2

Thread: Tooltip whit more than one text field?

  1. #1

    Thread Starter
    Member
    Join Date
    May 2017
    Posts
    39

    Tooltip whit more than one text field?

    It is possible to include in this code one tooltip with 2 fields? (One field to introduce the Alias of the router and other field to introduce the mac address)
    Code:
    rivate Sub UserControl_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
        Dim Alias As String
        Dim MAC As String
        
        
        
        If Button = vbLeftButton Then
            MousePointer = vbCustom
        ElseIf Button = vbRightButton Then
            With Extender
            
                 Alias = InputBox("Write the ALIAS:", _
                                   .ToolTipText, _
                                   .Parent.Left + x, _
                                   .Parent.Top + y)
                 MAC = InputBox("WRITE THE MAC ADDRESS:", _
                                   .ToolTipText, _
                                   .Parent.Left + x, _
                                   .Parent.Top + y)
                                   
                                   
                If StrPtr(Alias) <> 0 Then .ToolTipText = Alias
                If StrPtr(MAC) <> 0 Then .ToolTipText = MAC
            End With
        End If
    End Sub
    And then show all the information when I click in the control


    Code:
    Private Sub AccessPoint_Map3_Click(Index As Integer, ByVal Shift As ShiftConstants)
        
        If Shift And vbShiftMask Then
            'Delete this pin:
            AccessPoint_Mapa3(Index).Visible = False
        Else
            MsgBox "Access Point #" & CStr(Index) & " " & AccessPoint_Map3(Index).ToolTipText
        End If
    End Sub
    Thank you!

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,159

    Re: Tooltip whit more than one text field?

    Sure no problem simply append the strings together.
    Code:
    If StrPtr(Alias) <> 0 and StrPtr(MAC) <> 0 Then 
          .ToolTipText = Alias & " | " & MAC
    Else
         If StrPtr(Alias) <> 0 Then .ToolTipText = Alias
         If StrPtr(MAC) <> 0 Then .ToolTipText = MAC
    End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.