all groups > vb.net controls > july 2005 >
You're in the

vb.net controls

group:

Forms in forms


Forms in forms Jerry
7/19/2005 12:00:00 AM
vb.net controls:
Hi Ken, Herfried, Eric and the rest who can help,


thanks for your replies. They all worked, more or less.
Using the parent panel was ok, but when the form has the focus
the main form loses focus and the bar turns grey. works but looks wierd.

The MDI from Eric seems best. This brought me to the idea of making a
MDI application. So I packed a MDI in a MDI and that didn't work.

I'll tell you what I'm tring to do and maybe someone can lead the way.
I'm not an expert in VB. I learned Basic years ago and I'm
working my way through "Visual". I am using Visual Studio 2003.

What I want to do is create a main container for different calculations.
These calculations consists of several sub calculations.

In the main form when "calculation1" is selected from the main menu,
a form for this calculation should open in the main form.

The form for this calculation has a treeview, splitter and the space
in which the form according to the tree selection should open.

If "calculation2" is selected then a new form as above should open
and one can work on either calculation.

What I need is the backbone to such an application. How one would
do this. I'm sure this is a lot of info I'm asking for. So any book
suggestion or a link would be fine.


Thanks,

Jerry


Re: Forms in forms George Shubin
7/19/2005 10:23:57 AM
Have you tried using each "subform" as a control on the main form?

frm = New frmCalc1
frm.TopLevel = False
Me.Controls.Add(frm)
'Adjust subform's size and location
frm.Left = 10
frm.Top = 10
frm.Height = me.Height - 30
frm.Width = Me.Width - frm.Left - 20
Call ShowSubForm(frm.Tag.ToString)

Private Sub ShowSubForm(ByVal sTabKey As String)
'Bring to the front the sub-form corresponding to its identifying tag
value
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is Form Then
If ctl.Tag.ToString = sTabKey.ToString Then
ctl.BringToFront()
ctl.Show()
End If
End If
Next
End Sub


--
------------------------------------------------------------------------
George Shubin Custom Software Development
dX Software Systems Database Applications
Ph: 503-981-6806 Fax: 503-982-0120
www.dxonline.com george@dxonline.com
------------------------------------------------------------------------



[quoted text, click to view]

AddThis Social Bookmark Button