Hi Brandon,
Perhaps, I am not in the right track now. the more I code on, the heavier my
application is....
I would better to explain what I actually want here in order for you to get
the whole pic and correct me if i was wrong.
Well, actually I am writing a application using VB.Net
my application consist of "Treeview1" on the right panel as menu.
then i insert a splitter between "Treeview1" and "Panel1"
ok so my "Panel1" is on the most right hand size. with DOCK set to "Fill"
already.
so basically program interface is like the following
TreeView1 | Panel1
the | is the splitter, so i can resize it....
able to make "Treeview1" resizable and so "Panel1" does, caus the DOCK
already set to FIll
OK, now i add a new form on my application, named Form2.
I make a sub-menu item under "Treeview1" there.
when I click the sub-menu item, i want to show the Form2.
and want the "Form2" size based on the "Pane1" on "Form1"
and when i move the Splitter, i hope the "Form2" size will change
accordingly to Panel1
i dun know is it the right way to do that. or perhaps i am moving into the
wrong directon.
pls guide me
Brandon Potter said:
OK, then on Form1, handle the SizeChanged event of the panel...
Private Sub Panel1_SizeChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Panel1.SizeChanged
End Sub
And either include a call to a method to resize the form when Form2's
FormSize property is changed, or expose a public function on Form2 that
Form1 can call with the new size that will do the resize.
FWIW,
Brandon
A-PK said:
the problem is that my form2 size might change in run time...
depend on the form1 panel size
When I did this, not saying it's the technically correct way, but I
created
a public property like so in Form 2:
Private szFormSize As New Size
Property FormSize() As Size
Get
Return szSize
End Get
Set(ByVal Value As Size)
szSize = Value
End Set
End Property
So that when Form 1's button is clicked, it will create a new
instance
of
Form2 (or use an existing one) and set
frm2.FormSize.Height = [height]
frm2.FormSize.Width = [width]
And then use them appropriately in form2's load.
Or you can just access the frm2.Size property that's built in to the form
if
that floats your boat.
Brandon
Hey....
How could I set my Form2 boundary or size = Form1's Panel1
meaning that my form2 will open when I click on form1's particular
button.
and form2 will fill into Panel1, and if the size of panel changed during
run
time, the form2 size will change also.
and I have to set form2 fill and form1's panel.
pls guide