473,386 Members | 2,042 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.

tab focuses on disabled control

Shashi Sadasivan
1,435 Expert 1GB
Hi,
I have a 3rd party radio group control rg1, with a yes and a no field in it.
Then there are 2 textbox controls after that. t1 and t2
now on the focus leave event of the rg1 i want to set t1 to disbaled, and t2 enabled if rg1.selectedIndex = 0 (ie yes) and vice versa if 1;
But what happens is that, if rg1.selectedIndex is 0 then on tab event the focus is on t1 but t1 is disabled, so the user has to tab again to move to t2.

I cant use valuChanged or valuChanging event due to the nature of the windows form.

Any help is appreciated.
Thanks
Aug 22 '07 #1
5 1250
vinci
62
Hi,
I have a 3rd party radio group control rg1, with a yes and a no field in it.
Then there are 2 textbox controls after that. t1 and t2
now on the focus leave event of the rg1 i want to set t1 to disbaled, and t2 enabled if rg1.selectedIndex = 0 (ie yes) and vice versa if 1;
But what happens is that, if rg1.selectedIndex is 0 then on tab event the focus is on t1 but t1 is disabled, so the user has to tab again to move to t2.

I cant use valuChanged or valuChanging event due to the nature of the windows form.

Any help is appreciated.
Thanks
in the leave event u can try this:
Expand|Select|Wrap|Line Numbers
  1.  
  2. if (rg1.selectedIndex = 0) {
  3.       t2.focus();
  4. }
  5.  
hope i got ur requirement right...

enjoy coding
Aug 22 '07 #2
Shashi Sadasivan
1,435 Expert 1GB
in the leave event u can try this:
Expand|Select|Wrap|Line Numbers
  1.  
  2. if (rg1.selectedIndex = 0) {
  3.       t2.focus();
  4. }
  5.  
hope i got ur requirement right...

enjoy coding
I did that....but my form has a lot other controls, so I want the user to be able to tab back to the previous controls. If i use the leve even to focus on t1 or t2, then the user cannot use the keyboard to go back.....not a possible scenariio in this case
Aug 22 '07 #3
Plater
7,872 Expert 4TB
A correctly disabled control is not able to receive a tab-focus.
If your control is still getting focused, it is not actually disabled.
Aug 22 '07 #4
Shashi Sadasivan
1,435 Expert 1GB
A correctly disabled control is not able to receive a tab-focus.
If your control is still getting focused, it is not actually disabled.
Hi Plater...I thought of the same...
So what i did was i got the ActiveControl as soon as i left focus of my control and did the enabling and disabling...what i did then is to print the name and the text of the active controll...
surprisingly, it gave me the correct controls..but only the text in it. It was not able to get the name of the control.
Very frsutrating that im so close but its not working.
I think i'll make the editValueChangedEvent work on this one, to avoid the UI requirements.
(Sometimes its so weird that the functionality of what the program does is overlooked for the UI)
Aug 22 '07 #5
Shashi Sadasivan
1,435 Expert 1GB
Well , this time i chaned it to what i was fearing to do so, i put the code into the editValueChanging event.
This time...everything went as normal....but!!!!
im using bindingSource and datatables
The structure of the form -> i have a list of items that can edited (you can also add new items) on the left side of the form (just displaying item numbers 1,2,3,4....n)
When im in adding a new item, everything is good, but when i start clicking diffrent items, the radiogroup control goes whacky, and starts to load its value from the previous row, and if i select to save, it saves it for that specific item...
No clue why it behaves so weird
Aug 22 '07 #6

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

Similar topics

5
by: Mark Hannon | last post by:
I have been researching the "disabled" property for form data and wanted to know: - Does the disabled property supress the form item from being submitted? - Can the disabled property be applied...
3
by: Kelly Domalik | last post by:
I would like to override the "disabled" property of a hidden field. When disabled is set to "true", it would call a function to disable 2 other text fields on the form. When disabled is set to...
4
by: | last post by:
Please, help. I created my contol, ButtonX, which subclasses System.Forms.Windows.Button class. I am doing my own paiting, by overriding OnPaint and OnPaintBackground (without calling base...
3
by: Rachel Suddeth | last post by:
I didn't know what to put for a subject, so I just tell you a problem requirement they want for my ap. If the user hovers over a disabled control, they want a text bubble to explain why it's...
3
by: Steve Le Monnier | last post by:
When you make a textbox control disabled ( txtText1.Enabled = false; ) You're left with grey text on a greyer background, which is not ideal. The Read-Only property is no use to me as I need to...
6
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. ...
7
by: garyusenet | last post by:
I'm using krypton toolkit which has allowed me to make a cool looking form. However, when I set my textbox to disabled it is 'greyed' out. The grey colour isn't in keeping with the office 2007...
3
by: SergioQ | last post by:
Perhaps I am reading it wrong, but I assumed that the line below would cause the value of 1 to be sent to the form. Instead it's sending a 0. <input type="checkbox" name="email_00_notify"...
17
by: govolsbaby | last post by:
Is there a way to leave the button forecolor unchanged when it is disabled? I have multiple buttons on the form and depending on various user inputs, some will or will not be enabled but I'd...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.