M
Marc
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 AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click
Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)
Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
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.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next
ToolTip1.SetToolTip(NewBtn, s)
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 AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click
Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)
Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
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.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next
ToolTip1.SetToolTip(NewBtn, s)