Splitter

  • Thread starter Thread starter Duncan
  • Start date Start date
D

Duncan

Hi

I am using a splitter within a form with buttons on the
left hand side. I would like it so that when i click one
of these buttons it changes the UI on the right. I would
like to design all of my different screens at design time
and not run time if possible.

Very much like outlook where when you click on calendar
the calendar shows on the right, same with contact etc!

Any pointers would be greatly appreciated as i am having
great problems at the moment!

Many thanks

Duncan
 
Duncan said:
I am using a splitter within a form with buttons on the
left hand side. I would like it so that when i click one
of these buttons it changes the UI on the right. I would
like to design all of my different screens at design time
and not run time if possible.

Very much like outlook where when you click on calendar
the calendar shows on the right, same with contact etc!

Any pointers would be greatly appreciated as i am having
great problems at the moment!

I don't know whether I will be able to help you, but what is your question?
 
Duncan,

My first thought would be to create a user control for each of the screens
you require. Then in the place where you want the controls to be displayed
you can have a panel control (set to fill the space to the right of the
splitter). Then instantiate the requested control and and place it inside
the panel, here is some sample code

Dim ctl as New MyControl
Me.pnlScreen.Controls.Clear()
Me.pnlScreen.Controls.Add(ctl)
ctl.Dock = DockStyle.Fill

Dan
 
As I say that worked well, One thing, how would you make
it so that when you load up a new control and go back to
the old one that it maintains it's last state!

In other words, Put a text box on first control and
wrote something in it.

Second control loads fine.

First control again loads up fine but have lost the text!

Any idea?

Duncan
 
Duncan,

Where will the data be stored? If in the database why not comit the info to
the database and then requery it when the control is displayed? Or you
could look into serializing the control data and then de-serializing it
using the many methods in the Serialization assembly.

Have fun,
Dan
 
another thought although a little more memory intensive would be to store
the form/control (as they are requested) into a collection and then hide
them as a new form/control is requested. When the user request to show the
control hide the top most control and unhide the requested one.
 
Back
Top