Question:
Visual Basic auto-selects a radio button?
Mindstormscreator
2010-09-12 10:31:43 UTC
Hi,
In Visual Basic, whenever I draw a set of Radio Buttons, and whenever the form loads, one is always preselected, no matter what I do. I tried setting the TabIndex and TabStop properties in different ways, and no matter what, one is always preselected on load. I would prefer a way to make it not do this without any complicated BASIC code (which I haven't even learned much about yet), but if it must be done through code it is fine. I am using Visual Basic 6 by the way.

Thanks,
Alex
Three answers:
Aprone
2010-09-12 10:46:51 UTC
Short and simple solution is to make an extra radio button on your form/frame/whatever that you will use to represent "no choice from user". Keep it visible and set it to be selected initially, then move it out of view so the user will never see it. The remaining radio buttons will start up without any of them being selected until clicked.
2016-10-04 13:36:20 UTC
the proper answer: form has a property referred to as 'AcceptButton', this button's click journey fires while the enter secret's pressed and the form has concentration, so pass to Button1's form contained in the clothier, discover the AcceptButton property and decide Button1.
2010-09-12 10:42:11 UTC
Set the values of both to false.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...