By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,708 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Need a Listbox to mimic the combo dropdown list

P: n/a
I have a textbox with a lookup button facility. What I would like to do is also offer a quick selection facility by having a dropdown list appear under the control once the user has typed a single character. The same kind of functionality that you see on website textboxes these days.

I don't want to use a combo, but I do like the fact that the dropdown list from a combo is highlighted by moving the mouse. Is it possible to make a standard listbox behave like this.

I did try the hover select of a listview control, but it was nasty.

Many thanks

Steve Le Monnier
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Steve

For to achieve what you want, you need in my opinion the listbox.findstring

http://msdn.microsoft.com/library/de...tringtopic.asp

I hope this helps?

Cor
Nov 16 '05 #2

P: n/a
Thanks for the info.

I've looked at that and I'm not to worried abou find the items in the list
box, the effect I'm trying to acheive is that of the blue bar that follows
the mouse when you move it over the records. Just like it does with the
combo drop-down list.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:O%****************@tk2msftngp13.phx.gbl...
Steve

For to achieve what you want, you need in my opinion the
listbox.findstring

http://msdn.microsoft.com/library/de...tringtopic.asp

I hope this helps?

Cor

Nov 16 '05 #3

P: n/a
Steve

And did you select the item after finding it?

Cor
Nov 16 '05 #4

P: n/a
Hi Cor

I've found the solution I was looking for, so many thanks for your help. The solution itself was realy elegent and I'm kicking myself for not find it first. Anyway in the spirent of cooperation he is the code that's put a smile on my face.

private void listBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
listBox1.SelectedIndex = listBox1.IndexFromPoint(e.X,e.Y);
}

Many thanks

Steve

"Cor Ligthert" <no************@planet.nl> wrote in message news:eF**************@TK2MSFTNGP11.phx.gbl...
Steve

And did you select the item after finding it?

Cor

Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.