473,396 Members | 2,055 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,396 software developers and data experts.

Bug in Radio Button (or weird feature)

I think that I found a bug in the Radio Button, and I wanted to give
everybody a "Heads Up". I spent three days doing trial and error until
I found a work around.

I created a user control with a text box and two radio buttons. The
text box has the TabStop = True, and both radio buttons have TabStop =
False. The radio buttons are set to false so that a Tab (or captured
Enter) may tab to the next control. The appropriate radio button is set
depending if the text is negative or non-negative.

Here's the bugs:
1) Setting the TabStop property for the radio buttons in the user
control did not always hold the False value. If you go into the
designer code, there is no override code for setting the property. The
control will use its default of True.

2) Inserting the TabStop property setting in the design code would also
not stay. Very frustrating. There was much cursing.

3) Here's the Rosetta stone for the first two problems ... If you
programmatically change the checked radio button, the TabStop for the
radio button is apparently set back to True! Perhaps Microsoft
considers this to be a "feature", but I can't imagine why.

The workaround was to simply set both radio buttons back to false,
immediately after I changed the checked value. This seems to work,
although a bit heavy handed on the programming side.

If m_dblCode 0 Then
OptCheck.Checked = True
ElseIf m_dblCode < 0 Then
optDebit.Checked = True
Else
If m_IsCheckDefault Then
OptCheck.Checked = True
Else
optDebit.Checked = True
End If
End If
optDebit.TabStop = False
OptCheck.TabStop = False

Oct 23 '06 #1
1 2536
According to the documentation the default is false, not true.

Also, the very first thing that the documentation says about the
property might gives a clue to why you have trouble using it:

"This property supports the .NET Framework infrastructure and is not
intended to be used directly from your code."

Shane wrote:
I think that I found a bug in the Radio Button, and I wanted to give
everybody a "Heads Up". I spent three days doing trial and error until
I found a work around.

I created a user control with a text box and two radio buttons. The
text box has the TabStop = True, and both radio buttons have TabStop =
False. The radio buttons are set to false so that a Tab (or captured
Enter) may tab to the next control. The appropriate radio button is set
depending if the text is negative or non-negative.

Here's the bugs:
1) Setting the TabStop property for the radio buttons in the user
control did not always hold the False value. If you go into the
designer code, there is no override code for setting the property. The
control will use its default of True.

2) Inserting the TabStop property setting in the design code would also
not stay. Very frustrating. There was much cursing.

3) Here's the Rosetta stone for the first two problems ... If you
programmatically change the checked radio button, the TabStop for the
radio button is apparently set back to True! Perhaps Microsoft
considers this to be a "feature", but I can't imagine why.

The workaround was to simply set both radio buttons back to false,
immediately after I changed the checked value. This seems to work,
although a bit heavy handed on the programming side.

If m_dblCode 0 Then
OptCheck.Checked = True
ElseIf m_dblCode < 0 Then
optDebit.Checked = True
Else
If m_IsCheckDefault Then
OptCheck.Checked = True
Else
optDebit.Checked = True
End If
End If
optDebit.TabStop = False
OptCheck.TabStop = False
Oct 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: madforplaid | last post by:
Can anyone help me to figure out a strange span/radio button/JavaScript behavior? When clicking on the radio button for WEEK 2 below all works okay, but when clicking on the label for the same...
3
by: John Davis | last post by:
I created a ASP.NET Web Form using VB.NET with a text box, 2 radio buttons. When the user click the first radio button, the text will change to uppercase. If the user clicks the other radio button,...
0
by: vinay | last post by:
why are u not using the radiobutton list??? vinay >-----Original Message----- >I created a simple ASP.NET application with a text field, and 2 radio >buttons (uppercase and lowercase...
3
by: Amelyan | last post by:
When we want radio button to belong to a group name we say, radio1.GroupName="GroupA". In this case, radio1 will be unselected if another radio button is selected in "GroupA". Is there a way...
5
by: sam | last post by:
Hi all, I am dynamically creating a table rows and inerting radio buttons which are also dynamically created. Everything works fine in Firefox as expected. But I am not able to select radio...
2
by: dougawells | last post by:
Hi- I'm wanting to have a set of radio buttons disabled when a form is displayed, then if they check another specific radio button, those would become enabled. I've tried setting it via...
9
by: IchBin | last post by:
I can not see what the problem is with this script. I am just trying to set a radio button by calling setCheckedValue('abbr_letter', 'V'). Sorry I am new to javascript. <html> <head> <script...
10
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
8
by: photoboy | last post by:
I have racked by brain long enough on this, so now I need the help of someone who knows what they are doing. Here is what I am trying to achieve: First, I have two radio buttons (both unchecked)...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.