Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General / February 2005



Tip: Looking for answers? Try searching our database.

Option buttons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Newman - 28 Feb 2005 14:17 GMT
I have an array of option butons in Graphical style ( CmnOpt ).  When the
user first enters the form non of the option buttons are shown as pressed (
clicked ) , but only Cmdopt(0) is enabled.  Ehen that is clicked then
CmdOpt(1) become enables and cmdopt(0) is disables.

i have a standered cmd button which when clicked i want to reset the cmdopt
to the origional state , none showing a depressed state and only cmdopt(00
being enabled. im having loads of problems with this. any ideas's that do not
execute the  
cmdOpt_Click(Index As Integer) procedure ?
Noozer - 28 Feb 2005 14:25 GMT
> I have an array of option butons in Graphical style ( CmnOpt ).  When the
> user first enters the form non of the option buttons are shown as pressed (
[quoted text clipped - 3 lines]
> i have a standered cmd button which when clicked i want to reset the cmdopt
> to the origional state , none showing a depressed state
<snip>

Option buttons should *ALWAYS* have one button selected. If you need the
ability to have none selected, add another button labeled "NONE" or add a
checkbox to disable the option buttons.
Bjørnar Nilsen - 28 Feb 2005 14:32 GMT
>I have an array of option butons in Graphical style ( CmnOpt ).  When the
> user first enters the form non of the option buttons are shown as pressed
[quoted text clipped - 9 lines]
> execute the
> cmdOpt_Click(Index As Integer) procedure ?

Some hard to understand what your problem really is. "Enable" is a state
which can be true or false. If state is false, you can't get access to it in
run-time.

You have to use the property "Value" to determine if the optionbutton is
pressed/unpressed or "marked/unmarked".

mvh
B. Nilsen
Rick Rothstein - 28 Feb 2005 15:01 GMT
> I have an array of option butons in Graphical style ( CmnOpt ).  When the
> user first enters the form non of the option buttons are shown as pressed (
[quoted text clipped - 6 lines]
> execute the
> cmdOpt_Click(Index As Integer) procedure ?

I think you might be using the term "Enabled" incorrectly. When a
control's Enabled property is False, it cannot be interacted with. I
think the word you want is "selected". As to your question... if I
understand you correctly, I think this will do what you want

   Dim OB As OptionButton
   For Each OB In Cmdopt
      OB.Value = False
   Next

Rick - MVP
Ken Halter - 28 Feb 2005 15:33 GMT
>I have an array of option butons in Graphical style ( CmnOpt ).  When the
> user first enters the form non of the option buttons are shown as pressed
> (
> clicked ) , but only Cmdopt(0) is enabled.  Ehen that is clicked then
> CmdOpt(1) become enables and cmdopt(0) is disables.

It's kind of strange to enable/disable them like that (if I'm reading
correctly anyway...). If you want an option that sets them all to false, the
easiest way is to add another. At runtime, move the extra one off screen
(Left -70000 or something) and set it True. That'll set all others in that
group to False. It'll take some code to make sure that hidden button never
gets focus. If it gets focus, it'll set itself to True. What a pain eh?
<g>...

The "best" way is to add another option and set its caption = None. That
way, the user can easily see how to "unselect" the option.

Signature

Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.