Results 1 to 10 of 10

Thread: Option button problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2005
    Location
    Varna, Bulgaria
    Posts
    86

    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.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Option button problem

    Quote 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.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Option button problem

    Quote 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.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2005
    Location
    Varna, Bulgaria
    Posts
    86

    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

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Option button problem

    Quote 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.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    May 2005
    Location
    Varna, Bulgaria
    Posts
    86

    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 ?

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Option button problem

    Quote 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:
    1. Private Sub CreateButtonOne()
    2. Set btnButtonOne = Controls.Add("VB.CommandButton", "btnButtonOne")
    3.    With btnButtonOne
    4.    Set .Container = Frame1 '<====this is how you tell it what frame you want the control placed in.
    5.       .Visible = True
    6.       .Width = 1000
    7.       .Caption = "First Button"
    8.    End With
    9. End Sub

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Option button problem

    Quote 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?

  9. #9

    Thread Starter
    Lively Member
    Join Date
    May 2005
    Location
    Varna, Bulgaria
    Posts
    86

    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.

  10. #10
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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
  •  



Click Here to Expand Forum to Full Width