Need some code help with tool tip display text

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)
 
R

rowe_newsgroups

Cause 3 times is ucky

Not if you make us mad - we don't like multipostings.

BTW I answered this in other thread.

Thanks,

Seth Rowe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top