Solved

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

Posted on 2003-11-25
8
482 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
A short article about problems I had with the new location API and permissions in Marshmallow
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

803 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