Help.ShowPopup for all Textboxes on Form?

  • Thread starter Dean Richardson
  • Start date
D

Dean Richardson

Hello,

I have a large number of forms which contain an equally large number
of textboxes within (All textboxes have a prefix of txt before their
name). Is there a way that I can have the Help.ShowPopup to display
the contents of the textbox in which the mouse is hovering over?

The issue is that there is text in the text boxes, but cannot be seen
as the text is longer than the textbox.

I can use the following to display the contents of the textbox, but am
hoping there is a way that can work for all of the textboxes rather
than copying the same three lines per textbox as shown below:

Private Sub txtFullName_MouseHover(ByVal sender As Object, ByVal e
As System.EventArgs) Handles txtFullName.MouseHover
Help.ShowPopup(Me, txtFullName.Text, Cursor.Position)
End Sub

Thanks in Advanced.

LD
 
R

rowe_newsgroups

Private Sub txtFullName_MouseHover(ByVal sender As Object, ByVal e
As System.EventArgs) Handles txtFullName.MouseHover
Help.ShowPopup(Me, txtFullName.Text, Cursor.Position)
End Sub

The "Handles" statement says which events are handled by your method.
All you need to do is change the handles to include the other
textboxes:

Private Sub txtFullName_MouseHover(ByVal sender As Object, ByVal e
As System.EventArgs) Handles txtFullName.MouseHover, txt2.MouseHover,
txt3.MouseHover, txt4.MouseHover
Help.ShowPopup(Me, txtFullName.Text, Cursor.Position)
End Sub

Also, if you select all your textbox in the designer you should be
able to open the properties tab, set it to show events, and then
select "txtFullName_MouseHover" from the drop down list of choices for
MouseHover. Then the designer should take care of adding the events to
the method's Handle statement.

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