Help needed linking dynamic textboxs to tooltip text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc

    #1

    Help needed linking dynamic textboxs to tooltip text

    HI,

    I have a set of dynamically created buttons and textbox's. Each button
    is linked to a textbox using the accessiblename property. I want to
    show a button tool tip containing the text box's text. My code so far
    is below although i know this wont work!

    any help is greatly appreciated.


    Private Sub AddNewDriverToo lStripMenuItem_ Click(ByVal sender As
    System.Object, ByVal e As System.EventArg s) Handles
    AddNewDriverToo lStripMenuItem. Click

    Dim NewBtn As New Button()
    NewBtn.Accessib leName = CStr(Now)
    Me.Controls.Add (NewBtn)


    Dim NewTxt As New RichTextBox
    NewTxt.Accessib leName = NewBtn.Accessib leName
    Me.Controls.Add (NewTxt)

    Dim ctlControl As Control
    Dim s As String
    For Each ctlControl In Me.Controls
    If TypeOf ctlControl Is RichTextBox And
    ctlControl.Acce ssibleName = NewBtn.Accessib leName Then
    s = NewBtn.Text
    End If
    Next

    ToolTip1.SetToo lTip(NewBtn, s)

  • rowe_newsgroups

    #2
    Re: Help needed linking dynamic textboxs to tooltip text

    On Mar 2, 9:13 am, "Marc" <marc_cro...@ho tmail.comwrote:
    HI,
    >
    I have a set of dynamically created buttons and textbox's. Each button
    is linked to a textbox using the accessiblename property. I want to
    show a button tool tip containing the text box's text. My code so far
    is below although i know this wont work!
    >
    any help is greatly appreciated.
    >
    Private Sub AddNewDriverToo lStripMenuItem_ Click(ByVal sender As
    System.Object, ByVal e As System.EventArg s) Handles
    AddNewDriverToo lStripMenuItem. Click
    >
    Dim NewBtn As New Button()
    NewBtn.Accessib leName = CStr(Now)
    Me.Controls.Add (NewBtn)
    >
    Dim NewTxt As New RichTextBox
    NewTxt.Accessib leName = NewBtn.Accessib leName
    Me.Controls.Add (NewTxt)
    >
    Dim ctlControl As Control
    Dim s As String
    For Each ctlControl In Me.Controls
    If TypeOf ctlControl Is RichTextBox And
    ctlControl.Acce ssibleName = NewBtn.Accessib leName Then
    s = NewBtn.Text
    End If
    Next
    >
    ToolTip1.SetToo lTip(NewBtn, s)
    Answered in other thread.

    Quit posting the same question multiple times - it does not help it
    get answered faster.

    Thanks,

    Seth Rowe

    Comment

    Working...