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

Combo box question

P: n/a
Does anyone know of a way (using win32s perhaps) to eliminate that focus
rectangle over the selected option you see in a normal VB combo box?
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
What focus rectangle?? I can't even see one in a "standard" combo box!!
Have you got it set to Drop Down List or something??
_____________________________
The Grim Reaper

"Arlie Rahn" <ar*******@nospam.cox.net> wrote in message
news:AFYJc.8046$%p4.2086@okepread04...
Does anyone know of a way (using win32s perhaps) to eliminate that focus
rectangle over the selected option you see in a normal VB combo box?

Jul 17 '05 #2

P: n/a
Yeah, I have to use the list (allowing users to enter values wouldn't work
well). And, when you load the combo on the form a little focus rectangle
appears around the selected value. It's a little annoying - esp since I
can't control the color of it.

"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cd**********@hercules.btinternet.com...
What focus rectangle?? I can't even see one in a "standard" combo box!!
Have you got it set to Drop Down List or something??
_____________________________
The Grim Reaper

"Arlie Rahn" <ar*******@nospam.cox.net> wrote in message
news:AFYJc.8046$%p4.2086@okepread04...
Does anyone know of a way (using win32s perhaps) to eliminate that focus
rectangle over the selected option you see in a normal VB combo box?


Jul 17 '05 #3

P: n/a
Are you using a ComboBox with Style=2 Dropdown List
or are you using a ListBox with Style=1 Standard?

I have used the following in a ListBox (in the _Click procedure) to get rid
of the standard blue box highlight AND the focus rectangle.

List1.Enabled = False
List1.ListIndex = -1
List1.Enabled = True

Maybe the above, or some combination of the above, would work with the
ComboBox?

Tom
"Arlie Rahn" <ar*******@nospam.cox.net> wrote in message
news:AFYJc.8046$%p4.2086@okepread04...
Does anyone know of a way (using win32s perhaps) to eliminate that focus
rectangle over the selected option you see in a normal VB combo box?

Jul 17 '05 #4

P: n/a
I am using a combo box with style =2 Dropdown List.

If you want to mimic this, just create a project with a combo box, put in
4-5 values into it on load and select the first one after running the
project. You will see a small rectangular box around the value selected. I
would like to find a way to remove that.

"Kiteman - Canada" <-d*************@shaw.ca> wrote in message
news:qSEKc.57410$ek5.31890@pd7tw2no...
Are you using a ComboBox with Style=2 Dropdown List
or are you using a ListBox with Style=1 Standard?

I have used the following in a ListBox (in the _Click procedure) to get rid of the standard blue box highlight AND the focus rectangle.

List1.Enabled = False
List1.ListIndex = -1
List1.Enabled = True

Maybe the above, or some combination of the above, would work with the
ComboBox?

Tom
"Arlie Rahn" <ar*******@nospam.cox.net> wrote in message
news:AFYJc.8046$%p4.2086@okepread04...
Does anyone know of a way (using win32s perhaps) to eliminate that focus
rectangle over the selected option you see in a normal VB combo box?


Jul 17 '05 #5

P: n/a
I could not figure out a way to remove the rectangular box around the last
selected value in the pulldown menu without
Combo1.Clear
and then rebuilding the menu each time a combobox value is selected.

As for the highlight around the item displayed in the ComboBox before the
menu is pulled down you just have to set the focus to another control. You
can create a command button or another ComboBox and hide it behind your
existing control. Whenever the Combo1 receives a Change or Click event
just run this line of code:

Combo2.SetFocus
or
Command1.SetFocus

and the hidden ComboBox receives the focus and the highlighting disappears
from Combo1.

Hope this helps.

Tom
"Arlie Rahn" <ar*******@nospam.cox.net> wrote in message
news:YMmLc.2554$ml.76@lakeread05...
I am using a combo box with style =2 Dropdown List.

If you want to mimic this, just create a project with a combo box, put in
4-5 values into it on load and select the first one after running the
project. You will see a small rectangular box around the value selected. I
would like to find a way to remove that.

"Kiteman - Canada" <-d*************@shaw.ca> wrote in message
news:qSEKc.57410$ek5.31890@pd7tw2no...
Are you using a ComboBox with Style=2 Dropdown List
or are you using a ListBox with Style=1 Standard?

I have used the following in a ListBox (in the _Click procedure) to get

rid
of the standard blue box highlight AND the focus rectangle.

List1.Enabled = False
List1.ListIndex = -1
List1.Enabled = True

Maybe the above, or some combination of the above, would work with the
ComboBox?

Tom
"Arlie Rahn" <ar*******@nospam.cox.net> wrote in message
news:AFYJc.8046$%p4.2086@okepread04...
Does anyone know of a way (using win32s perhaps) to eliminate that focus rectangle over the selected option you see in a normal VB combo box?



Jul 17 '05 #6

P: n/a
While certainly a creative option, the problem with that solution is you
lose the ability to scroll through the options with the mouse wheel because
of the lost focus. I was hoping that there might be some sort of Win32 call
that controls the display of that focus rectangle, but it appears that may
not be the case.

"Kiteman - Canada" <-d*************@shaw.ca> wrote in message
news:BzwLc.73339$od7.64855@pd7tw3no...
I could not figure out a way to remove the rectangular box around the last
selected value in the pulldown menu without
Combo1.Clear
and then rebuilding the menu each time a combobox value is selected.

As for the highlight around the item displayed in the ComboBox before the
menu is pulled down you just have to set the focus to another control. You can create a command button or another ComboBox and hide it behind your
existing control. Whenever the Combo1 receives a Change or Click event
just run this line of code:

Combo2.SetFocus
or
Command1.SetFocus

and the hidden ComboBox receives the focus and the highlighting disappears
from Combo1.

Hope this helps.

Tom
"Arlie Rahn" <ar*******@nospam.cox.net> wrote in message
news:YMmLc.2554$ml.76@lakeread05...
I am using a combo box with style =2 Dropdown List.

If you want to mimic this, just create a project with a combo box, put in
4-5 values into it on load and select the first one after running the
project. You will see a small rectangular box around the value selected. I would like to find a way to remove that.

"Kiteman - Canada" <-d*************@shaw.ca> wrote in message
news:qSEKc.57410$ek5.31890@pd7tw2no...
Are you using a ComboBox with Style=2 Dropdown List
or are you using a ListBox with Style=1 Standard?

I have used the following in a ListBox (in the _Click procedure) to
get rid
of the standard blue box highlight AND the focus rectangle.

List1.Enabled = False
List1.ListIndex = -1
List1.Enabled = True

Maybe the above, or some combination of the above, would work with the
ComboBox?

Tom
"Arlie Rahn" <ar*******@nospam.cox.net> wrote in message
news:AFYJc.8046$%p4.2086@okepread04...
> Does anyone know of a way (using win32s perhaps) to eliminate that

focus > rectangle over the selected option you see in a normal VB combo box?
>
>



Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.