-
April 5th, 2009, 11:22 AM
#1
[RESOLVED] help about option buttons
please help me about option buttons [radio buttons] ..i want to put two frames on a form and two radio buttons each linked to one frame and other ... and how to make each frame equally in size on form ..
thanks in advance
-
April 5th, 2009, 11:36 AM
#2
Re: help about option buttons
Set the size of the frames the same either by dragging them out to the same size or by setting the height and width properties.
-
April 5th, 2009, 12:10 PM
#3
Re: help about option buttons
Originally Posted by DataMiser
Set the size of the frames the same either by dragging them out to the same size or by setting the height and width properties.
but sir, you left the main question that how options buttons can be linked to frames
code please
-
April 5th, 2009, 12:31 PM
#4
Re: help about option buttons
Just drop the Option Buttons inside the frame and they automatically work - there is no special "linking" or programming required
-
April 5th, 2009, 12:46 PM
#5
Re: help about option buttons
Originally Posted by George1111
Just drop the Option Buttons inside the frame and they automatically work - there is no special "linking" or programming required
sir, again ur answer is confussing me ... my project details
i have a form on one side of it .. i am putting suppose three frames with diffrent data on each frame and on the other side of form i have three radio buttons ...
suppose we give the name to radio button [ optionbtn1, optionbn2 and optionbtn2]
same for frames [ frmA, frmB and frmC]
i want when an option button 1 is clicked frmA should be visible on form while runtime and same procedure for other two
please provide the code
-
April 5th, 2009, 12:49 PM
#6
Re: help about option buttons
I think mahii wants the option button to select either frame. (Just guessing )
The easiest way to do so is to have your frames organized as an array.
Your option buttons are an array automatically if they have the same name.
Look into the Index property if there is 0 in one and 1 in the other, you have an array.
Now to the frames. Give them both the same name and you will be asked if you want an arry.
Say yes to that. Then control the Index properties if they are 0 and 1 too.
One or other way I assume that both frames will have the same size and occupy the same space.
Now comes the linking. In the click event of the OptionButton goes this code:
Code:
Private Sub Option1_Click(Index As Integer)
Frame1(Index).Visible = True
Frame1(Index).ZOrder 0
End Sub
Either Option button will bring its Frame to the foreground and make it visible.
Linking has been achieved by using the Index parameter which indicates which one of the option buttons was clicked.
Have to add: Neither of the OptionButtons must reside in one of the frames then.
You should examine the SSTab control which pretty much does all that stuff automatically.
Maybe that's what you want.
-
April 5th, 2009, 01:36 PM
#7
Re: help about option buttons
Originally Posted by WoF
I think mahii wants the option button to select either frame. (Just guessing )
The easiest way to do so is to have your frames organized as an array.
Your option buttons are an array automatically if they have the same name.
Look into the Index property if there is 0 in one and 1 in the other, you have an array.
Now to the frames. Give them both the same name and you will be asked if you want an arry.
Say yes to that. Then control the Index properties if they are 0 and 1 too.
One or other way I assume that both frames will have the same size and occupy the same space.
Now comes the linking. In the click event of the OptionButton goes this code:
Code:
Private Sub Option1_Click(Index As Integer)
Frame1(Index).Visible = True
Frame1(Index).ZOrder 0
End Sub
Either Option button will bring its Frame to the foreground and make it visible.
Linking has been achieved by using the Index parameter which indicates which one of the option buttons was clicked
Have to add: Neither of the OptionButtons must reside in one of the frames then.
You should examine the SSTab control which pretty much does all that stuff automatically.
Maybe that's what you want.
No sir i did not get properly ... tell me whole procedures of Array ... how to achives these
-
April 5th, 2009, 02:53 PM
#8
Re: help about option buttons
Code:
Dim Frame1(6) as Frame
will create 7 Frames (0-6)
You can also REDIM() if the count were to change
-
April 5th, 2009, 05:59 PM
#9
Re: help about option buttons
Well, this would be a programmatical way of doing it.
The way you make arrays at design time is, you drag a frame to your form.
Then you size and place it.
Then you might copy it (right click and copy) and paste (right click to form and paste) it again.
You will be asked if you want an array and simply have to say yes.
The other way of doing it during design, you drag another frame to your form.
It will automatically get named Frame2, if you had Frame1 before.
Now you select Frame2 and change its Name property to Frame1.
Again you will be asked if you want an array and you simply have to say Yes.
You have to understand, that an array of Frames is addressed by their index.
It is like a running number.
If you have 3 Frames, they might likely be addressed as Frame1(0), Frame1(1) and Frame1(2).
That's how elements of an array are addressed.
The Index is a property you can also determine in the property sheet of an object.
The above applies to all types of controls.
-
April 6th, 2009, 08:21 AM
#10
Re: help about option buttons
Originally Posted by WoF
Well, this would be a programmatical way of doing it.
The way you make arrays at design time is, you drag a frame to your form.
Then you size and place it.
Then you might copy it (right click and copy) and paste (right click to form and paste) it again.
You will be asked if you want an array and simply have to say yes.
The other way of doing it during design, you drag another frame to your form.
It will automatically get named Frame2, if you had Frame1 before.
Now you select Frame2 and change its Name property to Frame1.
Again you will be asked if you want an array and you simply have to say Yes.
You have to understand, that an array of Frames is addressed by their index.
It is like a running number.
If you have 3 Frames, they might likely be addressed as Frame1(0), Frame1(1) and Frame1(2).
That's how elements of an array are addressed.
The Index is a property you can also determine in the property sheet of an object.
The above applies to all types of controls.
thanks sir i got it ... thanks for right guidence ... but two problem is there i want fram1(0) should be an itroductuion page and should not be connected to any option button ... number 2nd i have lot of option buttons which are not possible to put on one form i want that other page should be created within the form so that all the option buttons could be adjusted ... help further please
-
April 6th, 2009, 11:26 AM
#11
Re: help about option buttons
-
April 6th, 2009, 12:04 PM
#12
Re: help about option buttons
If you do not want 1 or more frames included then do not make them part of the array. In other words just drag another frame onto the form which will have a different name by default and not be part of yoru array. Of course you must handle it seperately through code.
As for the number of options e.g. radio buttons. You can always use an additional group of frames to hold those as well, just need to add one or two in each frame to move next<>back. Same idea as before toggle the visibility of the frame in question.
That said if you are trying to place this many controls onto a single form you may run into an issue at some point. I often use 4-8 frames on Mobile apps but rarely on the pc.
Someone else suggested the use of a tab control instead but I see no response to that idea on your part. You may find this is a better solution for you. Also you may want to consider using more than one form.
-
April 6th, 2009, 05:28 PM
#13
Re: help about option buttons
First thing, I'd study the SSTab-control which is very versatile and takes a lot of programming away from its user.
Other consideration, DataMiser gave, is to take out your primary frame of your array and give it an individual name for individual proceedings.
To group OptionButtons you would have to use a frame, I think. You can use lot's of frames with the only purpose to group a set of option buttons. Just put them in an array, set the Border property to 0 and they are not visible at all in your app, but they group your OptionButtons as if they were Radio-buttons. (If you know what I mean).
-
April 7th, 2009, 12:17 AM
#14
Re: help about option buttons
i think my brothers did not get me properly ... i mean when we get option buttons and frames into an array ... then whenever we open the project at runtime there is always ist option button selected and ist frame visible.. i want that at runtime optionbutton 1 should not be highlighted and frame 1 should be visible as an introduction of the project.. it means at runtime let the user chose which option button should be selected as per their desire ..
-
April 7th, 2009, 12:28 AM
#15
Re: help about option buttons
You can save the settings in many ways. A file, a db, or in the registry (not recommended)
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
|