473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Focus to a disabled control?

I have a combobox. In the validating event of the combobox I check what value is chosen. If the value is "Skip" then I set the next control in the tabindex to enabled=false.

But when I tab out of the combobox and the value is "Skip", the activecontrol is the control just disabled in the validating event. Why does it set focus to a disabled control?
Dec 6 '07 #1
3 1256
Plater
7,872 Expert 4TB
Is this a web application or a windows application.
Disabled controls should not be able to receive focus.
Dec 6 '07 #2
Is this a web application or a windows application.
Disabled controls should not be able to receive focus.
It is a windows application.
Well I was not precise enough: When pressing tab in the combobox when "Skip" is chosen the following happens:

The ActiveControl of the form is the disabled control, but the focus stays in the combobox.
I had hoped the focus would go to the first enabled control after the combobox. That would seem logical to me.
Dec 6 '07 #3
Plater
7,872 Expert 4TB
Are you making the control disabled when the combobox loses focus? I could see that behavior happening in that situation.
Need to set the control to disabled before the lostfoucs event fires
Dec 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

31
by: Benno Bös | last post by:
If I use the following construct in the frame "main" for a link to an extern site: <A HREF="http://www.any.xy" TARGET="extern"> the Browser is creating the window "extern", loading the page...
4
by: Colleyville Alan | last post by:
I have 2 command buttons on a form. I want the first one to be enabled and the second one to be disabled when the form is opened. That works fine. Then, after the user has pressed the first...
0
by: Carlos Lozano | last post by:
Hello everybody, I Have a piece of code for a Pocket PC that has a disabled and hidden textbox control at startup. It is enabled and set visible programatically. The cursor is captured calling...
2
by: Marco Liedekerken | last post by:
Hi, Is it possible to retrieve the control that had the focus when the page was posted back? Because the focus is lost when a postback occurs I want to manually set the focus to the control...
4
by: PK9 | last post by:
I have a button at the top of my page that I have an onClick event handler for which makes some new controls (at the bottom of my page) visible. When the user clicks the button I make the new...
9
by: Zytan | last post by:
http://msdn2.microsoft.com/en-us/system.windows.forms.control.focus(VS.80).aspx this page says: "Focus is a low-level method intended primarily for custom control authors. Instead, application...
5
by: LabGeek | last post by:
I have an Access application that I have created that collects data from a scanner and from a weighting scale. The data from the scanner are unique identifiers (barcodes) and the scanner is...
5
by: Matt B | last post by:
I know this is a bit of nonstandard behavior, but I would like the Enter key to move focus through a group of radiobuttons without selecting them. The user would then have to use Space or actually...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.