Hack Forums
[.NET] Code to Disable combobox highlighting on select - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Code to Disable combobox highlighting on select (/showthread.php?tid=4615889)



Code to Disable combobox highlighting on select - ρãήžε® - Jan 2, 2015

Im desigining my form and i am using the normal combo box not the drop down list because it doesnt look good. Ive already disabled typing for it but when u click a item it highlights it automatically.what code can i use to disable it from highlighting when a item is selected within the combobox?


* - +Haze - Jan 2, 2015

Enable it, don't disable it. If it's disabled how are your users going to use it.
Do this, it will fix it.
[Image: kJ6O0Qk.png]

Changed the drop down style to list.


* - nathan72389 - Jan 2, 2015

there is no easy way of doing it. you could write your own control or use some hackey sendmessage call.


* - ρãήžε® - Jan 2, 2015

(Jan 2, 2015 11:03 AM)+Haze Wrote:  Enable it, don't disable it. If it's disabled how are your users going to use it.
Do this, it will fix it.
[Image: kJ6O0Qk.png]

Changed the drop down style to list.

i did that but it still is highlighting. The idea is to get rid of the blue highlight after a user has clicked a item


(Jan 2, 2015 11:04 AM)nathan72389 Wrote:  there is no easy way of doing it. you could write your own control or use some hackey sendmessage call.

yeah i figured it would take a long time to get rid of it


* - +Haze - Jan 2, 2015

Oh I completely misunderstood what you're asking for, and yeah Nathan is right.


* - SaketSaket - Jan 2, 2015

This might help you..

Code
ComboBox1.SelectedIndex = -1

Regards
Saket


* - ρãήžε® - Jan 2, 2015

(Jan 2, 2015 01:04 PM)SaketSaket Wrote:  This might help you..

Code
ComboBox1.SelectedIndex = -1

Regards
Saket

ive tried this before it clears the combo box of its inventory and nothing is left just except for blank space