Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How do VB6 decide which optionbuttons that are in family and which are not?

Posted on 2003-11-25
8
483 Views
Last Modified: 2010-04-17
My problem is that I have different groups of optionbuttons. In each group only one option can be selected (at least - that's the goal here).
Let me figurate a scenario:

I have 3 groups of 4-6 optionbuttons, respectivly called "Source", "Orientation" and "Scaling"
Each group is an control array.
"Source" is working great (only one selected at every time, and the option doesn't disapear when selected an option in any of the other two groups.
"Orientation" and "Scaling" is where the problem starts.

When I press the 1st option in "Orientation" the 2rd option from "Scaling" disapear, and when selected the 2nd from "Orientation"
the 3rd one in "Scaling" disapar (that is - the selection mark (if it is selected)).

My conclusion is that these buttons are somehow in family or bounded, but each group (and also each control array) is in three different
containers (Frames named fraSource, fraOrientation and fraScaling)

I've tried "everything" from not using control arrays to using picture boxes, still same behavor.

Anyone that can point me in a direction of a solution will have my eternal respect.
Regards,
John
0
Comment
Question by:jonrodde
8 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 9823134
AFAIK, each group of option buttons sould belong to it's frame. All option buttons which don't belong to any frame belong to one group.
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 50 total points
ID: 9824142
show the code that you have wriiten, and then maybe we can point out where the error is.

AW
0
 

Expert Comment

by:kingbailey2000
ID: 9824542
This may sound obvious but remember the frames must go onto a form before the option buttons
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 100

Expert Comment

by:mlmcc
ID: 9824838
Also you can't move an existing option button into a frame it must be created in the frame.

mlmcc
0
 
LVL 2

Author Comment

by:jonrodde
ID: 9825835
Arthur_Wood; you've got a point there... I thought that it had something to do with the bounding thing... but no.
It was my code.. too much copy/paste is really dangerous.

Case 2:
            If optScaling(Index).Value = True Then
                SetScaling (ANAMORPHIC)
                AddText Now & " --- Scaling: Changed to 'Anamorphic'", frmMain.txtDebug
                For i = 0 To 1
                    optOrientation(i).Value = False
                Next i
                optScaling(3).Value = False
                optScaling(4).Value = False
            End If

The optOrientation had nothing to do in there... it was just forgotten from the copy/paste.
Now who deserves the point? Arthur_Wood?

-John
0
 
LVL 3

Expert Comment

by:wonkotsane
ID: 9845488
The way vb decides which option buttons belong to which group depends on what container the option button is in.  The form is a container and so is a frame.  You don't even have to have the frame visible, just a hidden frame will do to define groups of option buttons.
0
 

Expert Comment

by:AbhijitCPatil
ID: 9849526
hi

use different frames for different groups
like
if you have three options for 1 st group
insert a frame and then insert 3 option buttons in it
like this you can solve ur prpblem

0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9852093
you CANNOT simply pick up a Radiobutton that is already on the form and drag-and-drop it into the frame.  The radiobutton is STILL drawn on the form(which remains it container), not the frame.  You MUST create the radio-buttion in the FRAME to begin with, so the FRAME is the container of the RadioButton, and the Form is Container of the Frame.

AW
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This is an explanation of a simple data model to help parse a JSON feed

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question