Checkbox and selectnextcontrol

K

kiwisurfer in UK

When selecting a Checkbox using the SelectNextControl() method, i've noticed
that the checkbox does not display the focus rectangle.

By writing a simple application with a button and two checkboxes (where the
checkboes have a tab index value greater than the button's), invoking the
SelectNextControl() method from the button click event handler, silently
moves focus to the first checkbox, but no focus rectangle is displayed.

Pressing TAB once, moves the focus to the second checkbox, which can be seen
as the focus rectangle IS displayed.

Any suggestions on how to get the focus rectangle to display for a checkbox
when using the SelectNextControl() method to move to it initially?
 
R

Ravi Bhavnani

Perhaps you could try faking a click/unclick operation on the selected
checkbox by calling PerformClick() twice, thereby getting it to display the
focus rect? This of course assumes you don't have a lot of code behind the
checkbox's click handler.

/ravi
 
D

Daniel Lee

Try adding these 2 lines in the forms Load event as a work around

SendKeys.Send("{TAB}+{TAB}")
Me.Refresh()



kiwisurfer in U wrote:

Checkbox and selectnextcontrol
14-Feb-08

When selecting a Checkbox using the SelectNextControl() method, i've noticed
that the checkbox does not display the focus rectangle

By writing a simple application with a button and two checkboxes (where the
checkboes have a tab index value greater than the button's), invoking the
SelectNextControl() method from the button click event handler, silently
moves focus to the first checkbox, but no focus rectangle is displayed.

Pressing TAB once, moves the focus to the second checkbox, which can be seen
as the focus rectangle IS displayed

Any suggestions on how to get the focus rectangle to display for a checkbox
when using the SelectNextControl() method to move to it initially?

Previous Posts In This Thread:

Checkbox and selectnextcontrol
When selecting a Checkbox using the SelectNextControl() method, i've noticed
that the checkbox does not display the focus rectangle

By writing a simple application with a button and two checkboxes (where the
checkboes have a tab index value greater than the button's), invoking the
SelectNextControl() method from the button click event handler, silently
moves focus to the first checkbox, but no focus rectangle is displayed.

Pressing TAB once, moves the focus to the second checkbox, which can be seen
as the focus rectangle IS displayed

Any suggestions on how to get the focus rectangle to display for a checkbox
when using the SelectNextControl() method to move to it initially?

Perhaps you could try faking a click/unclick operation on the selected
Perhaps you could try faking a click/unclick operation on the selected
checkbox by calling PerformClick() twice, thereby getting it to display the
focus rect? This of course assumes you don't have a lot of code behind the
checkbox's click handler

/rav

--------------------
message

Submitted via EggHeadCafe - Software Developer Portal of Choice
A Developer's Guide To SQL Server Profiler
http://www.eggheadcafe.com/tutorial...d8-ce1600d6db80/a-developers-guide-to-sq.aspx
 
W

Wilson, Phil

I suspect the original poster no longer cares after two years. Do you see
that date this was posted?
 
J

Jeff Johnson

I suspect the original poster no longer cares after two years. Do you see
that date this was posted?

I've given up. It seems EggHead Cafe is the new AOL when it comes to
admitting twits to the Internet. Only now they're admitting them to USENET!
 
D

Daniel Lee

Yes, I did notice the date. Hopefully my post will help those that arrive here in the future if not those who are no longer interested. Although the original post is 2 years old the bug still remains in the CheckBox control.



Wilson, Phil wrote:

I suspect the original poster no longer cares after two years.
01-Feb-10

I suspect the original poster no longer cares after two years. Do you se
that date this was posted
-
Phil Wilso
The Definitive Guide to Windows Installe
http://www.apress.com/book/view/1590592972

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
An Alexa Site Data Utility Class
http://www.eggheadcafe.com/tutorial...e-0069a2601d21/an-alexa-site-data-utilit.aspx
 
J

Jeff Johnson

Yes, I did notice the date. Hopefully my post will help those that arrive
here in the
future if not those who are no longer interested. Although the original
post is 2 years
old the bug still remains in the CheckBox control.

It is generally considered bad Netiquette to reply to old posts, and in the
fast-paced world of the Internet, even a few weeks in considered old, let
alone a couple of years. You'll receive far more flak for doing so than
praise.
 
S

Scott M.

It is generally considered bad Netiquette to reply to old posts, and in
the fast-paced world of the Internet, even a few weeks in considered old,
let alone a couple of years. You'll receive far more flak for doing so
than praise.

Um, that's hardly true at all. If there is something relevant to add to a
thread - - even after the fact, useful information is always welcomed. And
a couple of weeks is not considered old when it comes to technical questions
and posting replies to them.

-Scott M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top