Showing Frames from another form in a Frame
Hopefully this won't be confusing but I'm having a real hard time figuring this out...
I am trying to have a Frame from another Form show in a frame in a different form..
Example:
Form1 has Frame1 on it
Form2 has Frame2 on it
Form3 has Frame3 on it
I would like for Frame1 on Form1 to be able to show Frame2 from Form2 or Frame3 from form3..
Basically I have 2 radio buttons on the main form (form1) the user selects radbutton1 (=true) then Frame2.visible = true inside of Fram1 (which is just a blank frame that is a place holder for the other frames)
If a user select radbutton2 = true then I need Frame3 from Form3 to be visible in Frame1.
I realize I could put Frames over the top of each other and make them visible and invisible in that form, but that is a pain in the ***....
Just wondering if anyone has any ideas on how to do this in a more inelligent manner. THanks!
GPUKILLER
1 Attachment(s)
Re: Showing Frames from another form in a Frame
Think I get the jist of what your saying. Would a tabbed dialog do the job? If not, you could maybe post a screenshot of your forms.
Check this out though,
Hope it helps
Re: Showing Frames from another form in a Frame
did you know that you can move controls programmatically? indeed, this is how a tabbed dialog control works
put all your frames on the form and design them
when the app starts up, movethem all away, eg. move them all so their left is -5000. that's 5000 twips off the left ege of the screen/form
then when you want to activate them, move them into view. that's how a tabbed dialog control does it..
but you'd be better off using a tab control like wizbang suggests.. he might have a name like a household cleaning chemical, but he knows his stuff! ;)
Re: Showing Frames from another form in a Frame
Unfortunetly by popular demand it has been requested to use radio buttons instead of the tabstrip. I think I figured out a different way to do this. I will simply create seperate user controls. Plop them on top of one another, and make them invisible/visible when the selects that radio button, and that will allow me work on the seperate controls away from the form. This way it's more organized, since I'll be working on the seperate controls all the time.....
Re: Showing Frames from another form in a Frame
One question: Why would you want to put the frames on different forms?
You can pull a control from one form onto another using the SetParent API, but positioning the control, and using the events and such would be a different matter, because vb still treats the control as being a child window of the orginal form. You can use the Container property to place controls into the frame, but it needs to already be on the form. At this point, it sounds to me that you may benefit from using a control array. Then you can use the same events for all the frames and/or controls. You can also use the ZOrder property to put a control on top of other controls which may overlap it.
As suggested by cjard, moving the controls out of view is another way to do it. You can still use an array, and a simple loop can go through all the frames, and set them out of the way, or in view, depending on the index of the selected OptionButton. Either moving them, setting them invisible, or setting the ZOrder can work. There may be other easy ways depending on the results you are trying to achive.
1 Attachment(s)
Re: Showing Frames from another form in a Frame
Here is an example for you to look at. I think you will see how easy it really is.