Home All Groups Group Topic Archive Search About

Help.ShowPopup for all Textboxes on Form?

Author
2 May 2007 10:42 AM
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

Author
2 May 2007 10:55 AM
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


On May 2, 6:42 am, Dean Richardson <advertis***@deanrichardson.com>
wrote:
Show quoteHide quote
> 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