Help with seeing full text in wjen placing mouse of row of combobox

How do can I see all the text of a row  when I place the mouse on a row of my combo box using VB.NET?. The text is too long and not very user friendly not to be able to read the entire text.

Thanks,

Victor
vcharlesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

adriankohwsCommented:
You can drag and extend the length of a combobox. What you meant by not user-friendly?

This is not a good way of doing but just showing you some events you can make use of.
When you put your mouse there at this combobox2, the length will increase 200 pixels, but as I mentioned, you can always increase the width of the object in designer.

    Dim y As Integer = Me.Width
    Private Sub ComboBox2_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox2.MouseHover
        sender.Width = y + 200
    End Sub

    Private Sub ComboBox2_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox2.MouseLeave
        sender.Width = y
    End Sub
0
Jacques Bourgeois (James Burger)PresidentCommented:
I do that with a ToolTip.

Simply add a ToolTip control to your form. It will fall in the control tray at the bottom of the form designer window.

In the SelectedIndexChanged event of the ComboBox, have code like the following:

Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
          ToolTip1.SetToolTip(ComboBox1, ComboBox1.Text)
End Sub

Open in new window

The user simply has to hover over the ComboBox to see the full text.
0
vcharlesAuthor Commented:
I tried the tooltip bit it does not work, are you certain the code is in the right section? Also tried to include it in Mousemove section but still does not work.

Thanks.
0
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

vcharlesAuthor Commented:
Hi,

  sender.Width = y does not returm the width to its original size.

Thanks
0
vcharlesAuthor Commented:
Tooltip works after you select a row, how do you get it to work when the dropdown list appears?
0
Jacques Bourgeois (James Burger)PresidentCommented:
To have the thing work before a selection is made, you have many options.

Set a default ToolTip text, either in the ComboBox properties (it has a ToolTip property once you add one on the form) or by calling ToolTip1.SetToolTip in the form load.

You can also trigger the SelectedIndexChanged when the form loads, and thus calling your code, either by typing the default selection text in the Text property of the form designer, or by setting the selection through code in the Load event of the form.
0
vcharlesAuthor Commented:
Sorry not clear, how do I set a default ToolTip text to see all text when I place the mouse on a row?
0
adriankohwsCommented:
Can I have updates, what version of VS you guys using, my VS2005 doesn't have a tooltip for combobox.... I have no later VS versions yet.
0
Jacques Bourgeois (James Burger)PresidentCommented:
Add a line like the following in the Form_Load event, with any text that you want to show in the tooltip until the user makes a selection, or with the text that appears as the default entry in the ComboBox when it first show on the screen:

ToolTip1.SetToolTip(ComboBox1, "Use this list so select something")

or

ToolTip1.SetToolTip(ComboBox1, ComboBox1.Text)

This way the tooltip will display what you want before the user makes the first selection.
0
Jacques Bourgeois (James Burger)PresidentCommented:
@Adrian

The ToolTip property appears only after you put a ToolTip control on the form. This automatically adds a ToolTip property to all the controls on the form.

This is something that I talk about in my training sessions, and I kind of remember that it has been there since the very first version of the framework. So you should have it in 2005.
0
vcharlesAuthor Commented:
Hi,

I'm using visual studio 2010, I tried your approach but I don't see the full text unless I select a row. I need to see the full while the dropdown list appears as I move my mouse over the rows.

Thanks,

Victor
0
Jacques Bourgeois (James Burger)PresidentCommented:
Ooops. I did not get your question right. If I did, you would have had a very easy answer from the start.

You want to see the text while you move down the list of an opened ComboBox. I was on the impression that you wanted to see it when the selection was made and the list was closed. This is what my solution was giving you up to now.

If you want to see the text larger in the list, then simply change the DropDownWidth property of the ComboBox. You learn something here. When you want to do something with a control, first look through its properties. Very often, the solution is right there for you.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vcharlesAuthor Commented:
Thanks.
0
adriankohwsCommented:
Funny, so isn't my first reply: You can drag and extend the length of a combobox. answered the question already??? lol.

And thanks for the reply regarding the tooltip, I have lost track, long didn't touch any coding, forgotten most of the things....
0
vcharlesAuthor Commented:
Hi,

Due to design issue, I was not able to increase the length of the combobox, but didn't know I could extend the size of the dropdown without extending the length of the control.

Thanks,

V.
0
Jacques Bourgeois (James Burger)PresidentCommented:
Note that you can use a combination of both suggestions. DropDownWidth for the list and the ToolTip when the list is closed.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.