|
-
Aug 11th, 2005, 06:29 AM
#1
Thread Starter
Lively Member
Option button problem
Hello again.Here I have some problem.I have OptionButton(0),OptionButton(1),OptionButton(2) and OptionButton(3) and I want to group OptionButton(0) and OptionButton(1) in one group and OptionButton(2) and OptionButton(3) in other WITHOUT PUTTING THEM IN DIFFERENT PICTURES BOXES or something else.
-
Aug 11th, 2005, 06:38 AM
#2
Re: Option button problem
 Originally Posted by AnTo
Hello again.Here I have some problem.I have OptionButton(0),OptionButton(1),OptionButton(2) and OptionButton(3) and I want to group OptionButton(0) and OptionButton(1) in one group and OptionButton(2) and OptionButton(3) in other WITHOUT PUTTING THEM IN DIFFERENT PICTURES BOXES or something else.
If not picture boxes, then frames. If not frames, then something else, but you can not group option buttons together that are within the same container (like a form). You HAVE to separate them by putting them into a different container control like a frame or a picture box.
Otherwise, all options buttions regardless of how many, will be all grouped together.
-
Aug 11th, 2005, 06:50 AM
#3
Re: Option button problem
 Originally Posted by Anto
Hello again.I understand that I can't group optionbuttons in same container.Well would you thell me then how to load for example optionbutton(3) in frame1 ? optionbutton(3) don't exist and I want to load it in frame1.
Place a frame or a picture control on your form. Size it to your needs.
Click on an option button that you wish to place in this container. Right Click, and click Cut.
Click on the container you just placed on your form. Right mouse click, and click Paste. Move the option button to its desired location within the new container, and repeat the process for each button that you wish to be in that group.
For buttons that are not on the form yet, do not double click on the button from the toolbar. Single click on the option button, place your mouse within the proper container, and draw the control out.
-
Aug 11th, 2005, 07:00 AM
#4
Thread Starter
Lively Member
Re: Option button problem
yeah ... I know how it's happend, but the optionbutton doesn't exist yet 
I have optionbutton(1) in one frame and optionbutton(2) doesn't exist.When I click Command1 then the optionbutton is loaded , but it's not in frame2
-
Aug 11th, 2005, 07:10 AM
#5
Re: Option button problem
 Originally Posted by AnTo
I have optionbutton(1) in one frame and optionbutton(2) doesn't exist.When I click Command1 then the optionbutton is loaded , but it's not in frame2 
Then just cut 'n paste it into frame2.
-
Aug 11th, 2005, 07:23 AM
#6
Thread Starter
Lively Member
Re: Option button problem
heh ... but I load optionbutton(2) in source (because I don't know how meny optionbuttons I need (user enter the number)).I just write load optionbutton(2).How to load that optionbutton in existing frame ?
-
Aug 11th, 2005, 08:05 AM
#7
Re: Option button problem
 Originally Posted by AnTo
heh ... but I load optionbutton(2) in source (because I don't know how meny optionbuttons I need (user enter the number)).I just write load optionbutton(2).How to load that optionbutton in existing frame ?
Well, you posed a very interesting question. One that I had not encountered before. It took a bit of playing around, but I think I have something you can use. I created a new project and used a command button object (only because that is the first thing that came to mind, but you can easily replace that with the option button), and finally got it to place the button within a frame that I specified. You will need to modify this to suite your needs, but it should get you going in the right direction.
VB Code:
Private Sub CreateButtonOne()
Set btnButtonOne = Controls.Add("VB.CommandButton", "btnButtonOne")
With btnButtonOne
Set .Container = Frame1 '<====this is how you tell it what frame you want the control placed in.
.Visible = True
.Width = 1000
.Caption = "First Button"
End With
End Sub
-
Aug 12th, 2005, 05:21 AM
#8
Re: Option button problem
 Originally Posted by Anto
It really works, but can I load new object with index because in my form I may have ... 100 or more CommandButtons (or checkboxes) and in the and I have to count them.
Comments/questions regarding issues that you are having with your program should be posted in the open forum, not in a PM.
What is the scope of your project? What are you trying to do? What is the end goal?
-
Aug 13th, 2005, 03:08 AM
#9
Thread Starter
Lively Member
Re: Option button problem
I'm making program for this year competitions of informatical technologies.The program is makeing tests and the students have to fill in the test.Then I have to check if the answer is right or not.Thats all.If you want I can give you the source , but the interface is in bulgarian.
-
Aug 13th, 2005, 06:48 AM
#10
Re: Option button problem
Ok. So why the need to create option buttons dynamically?
If you have a test that is being given, then you know the questions and know the possibilities for the answers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|