Windows Develop Bookmark and Share   
 index > Windows Forms General > User interface question
 

User interface question

Hi all,

I'm building a software which has a UI similar as outlook 2003. The problem I'm facing is how can I perform dynamic content change while the user click the navigation buttons.
I did think about using MDI but that is not what I want as it obviously not how the outlook implement. Thus, i think about using panels and swap between them. However, it seems very hard to design as i need to cover a new panel to the previous one.

It anyone can tell me how outlook implement the dynamic content change?

thxs alot.
D11  Thursday, June 29, 2006 5:29 PM

Build User Controls for all the views that you want. You can pretty much encapsulate most of the work inside each view. If you need an outside manipulation. You can expose a property or a method. If you need the user control to notify the parent/container, you create an event delegate. You might want use a panel on the main form to hold the views.

Ex user controls.
1. Calendar
2. Email
3. Contacts
and so on...

Create a user control for the side bar that contains the buttons to toggle the view. This way you can encapsulate how the side bar should behave. Create an event delegate for the button corresponding to the view.

Ex.

Define an event delegate CalendarButton_Click(I usually just use the argument that comes with the default Button_ClickEvent) that you want to bubble up.
Inside the default btnCalendarButton_Click add RaiseEvent CalendarButton_Click(sender, e);

Now your mainform can catch the event of the sidebar buttons. You will see your custom events for the sidebar under the Misc Category (click on the Lightning Icon).

The actual event should look something like this;

CalendarButton_Click
{
  if (cal == null)
  {
     cal = new CalendarView(); // in this case cal is a class level object
     panel.Controls.Add(cal);
   }

   cal.Visible = true;
   email.Visible = false;
   contact.Visible = false;

My personal approach is to;
1. Use a property or method to communicate with the child control
2. Use an event delegate to make the child control communicate with the parent

JRQ  Monday, July 03, 2006 3:47 PM
I don't know how Outlook actually does it, but it shouldn't be hard to create a few panels (or usercontrols), and set their Visible properties whenever you want to switch to a different one.
sirjis  Thursday, June 29, 2006 7:10 PM

There are couple of articles available at codeproject.com...

Check this link

http://www.codeproject.com/article.asp?tag=19420762603638880

thukralz  Thursday, June 29, 2006 7:49 PM

Create a custom usercontrol for each view. This way you can just toggle their visibility depending on the button that was click. Usercontrol creation is thekey to creatinga UI that is very complicated.

JRQ  Thursday, June 29, 2006 9:38 PM

Hi JRQ,

What you said does make sense to me but can you provide some exmple about how to actually implement that because I'm still confuse about how to implement custom view.

By the way, I'm using c# to build the program.

Thxs alot,

D11
D11  Sunday, July 02, 2006 7:37 PM

Build User Controls for all the views that you want. You can pretty much encapsulate most of the work inside each view. If you need an outside manipulation. You can expose a property or a method. If you need the user control to notify the parent/container, you create an event delegate. You might want use a panel on the main form to hold the views.

Ex user controls.
1. Calendar
2. Email
3. Contacts
and so on...

Create a user control for the side bar that contains the buttons to toggle the view. This way you can encapsulate how the side bar should behave. Create an event delegate for the button corresponding to the view.

Ex.

Define an event delegate CalendarButton_Click(I usually just use the argument that comes with the default Button_ClickEvent) that you want to bubble up.
Inside the default btnCalendarButton_Click add RaiseEvent CalendarButton_Click(sender, e);

Now your mainform can catch the event of the sidebar buttons. You will see your custom events for the sidebar under the Misc Category (click on the Lightning Icon).

The actual event should look something like this;

CalendarButton_Click
{
  if (cal == null)
  {
     cal = new CalendarView(); // in this case cal is a class level object
     panel.Controls.Add(cal);
   }

   cal.Visible = true;
   email.Visible = false;
   contact.Visible = false;

My personal approach is to;
1. Use a property or method to communicate with the child control
2. Use an event delegate to make the child control communicate with the parent

JRQ  Monday, July 03, 2006 3:47 PM

You can use google to search for other answers

Custom Search

More Threads

• Help Needed! Debugging a error
• Need to retrieve and set a variable equal to a return value from ASP page using a WebBrowser control...
• listview sorting
• Parent Buttons to call child's method
• C# Dice Question
• Hide child controls of USERCONTROL based on tab.
• Trial software development
• file copy problem
• Do I need to do a cross-thread invoke to read a property?
• Comparer Inconsistency