1

I'm building an application and I have a TextBox control that is filled with a value. On some occasions the control is too small and I don't have the space to expand it.

How do you show the TextBox content on hover when the control is too small?

Blackwood
  • 4,504
  • 16
  • 32
  • 41
Mech_Engineer
  • 535
  • 1
  • 19
  • 46
  • 1
    are we talking about WinForms? WPF? Silverlight? ASP .NET? – Alex B. Jul 07 '16 at 11:20
  • 1
    Possible duplicate of [Showing Textbox ToolTip](http://stackoverflow.com/questions/11543318/showing-textbox-tooltip) – Andrew Mortimer Jul 07 '16 at 11:20
  • Try the following link. If you only want the tool tip to show for certain values then add an if condition for the text box. http://stackoverflow.com/questions/168550/display-a-tooltip-over-a-button-using-windows-forms – coder32 Jul 07 '16 at 11:51

2 Answers2

1

Add a tooltip to the form and the following code

 Private Sub TextBox1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.MouseHover
    ToolTip1.SetToolTip(TextBox1, TextBox1.Text)
End Sub
slippy
  • 11
  • 1
0

This has the same answer as this question: Showing Textbox ToolTip

Private _toolTip As New ToolTip()

Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) _
                                 Handles TextBox1.TextChanged
  _toolTip.Show(TextBox1.Text, TextBox1)
End Sub
Community
  • 1
  • 1
Stefano d'Antonio
  • 5,874
  • 3
  • 32
  • 45