Click here to Skip to main content
16,004,944 members
Home / Discussions / C#
   

C#

 
AnswerRe: Back link Pin
Nick Parker14-Oct-06 4:59
protectorNick Parker14-Oct-06 4:59 
Questionneed help or advice... [modified] Pin
TheCardinal13-Oct-06 21:12
TheCardinal13-Oct-06 21:12 
AnswerRe: need help or advice... Pin
mav.northwind13-Oct-06 21:56
mav.northwind13-Oct-06 21:56 
AnswerRe: need help or advice... Pin
Nader Elshehabi14-Oct-06 2:59
Nader Elshehabi14-Oct-06 2:59 
GeneralRe: need help or advice... Pin
TheCardinal14-Oct-06 3:38
TheCardinal14-Oct-06 3:38 
GeneralRe: need help or advice... Pin
mav.northwind14-Oct-06 6:08
mav.northwind14-Oct-06 6:08 
GeneralRe: need help or advice... Pin
Nader Elshehabi14-Oct-06 6:46
Nader Elshehabi14-Oct-06 6:46 
GeneralRe: need help or advice... Pin
TheCardinal14-Oct-06 17:54
TheCardinal14-Oct-06 17:54 
I see. Thanks mav and nader Smile | :)

I really wanted to implement this as part of my UI. I have created an mdi application that mimic the MS MONEY 2006 tab bar

tab ---> HOME BILLING INVENTORY

So if i click on the HOME TAB, it will only load a single form. this is all done in my FrmMain. this is why i have this sub.
private void SelectTabToView(string sWhatTab)
       {
           switch (sWhatTab.ToUpper()) {
               case "HOME":
                   FrmHome F1 = new FrmHome()
                   F1.MdiParent = this;
                   F1.Dock = DockStyle.Fill;
                   F1.Show();
                   //
                   this.pnlCompositeCon.Controls.Clear();
                   this.pnlCompositeCon.Controls.Add(F1);
                   this.txtCurrentLoadedForm.Text = F1.Name.ToUpper();
                   break;
               case "BILLING":
                   FrmHome F2 = new FrmHome()
                   F2.MdiParent = this;
                   F2.Dock = DockStyle.Fill;
                   F2.Show();
                   //
                   this.pnlCompositeCon.Controls.Clear();
                   this.pnlCompositeCon.Controls.Add(F2);
                   this.txtCurrentLoadedForm.Text = F2.Name.ToUpper();

                   break;
               case "INVENTORY":
                   FrmHome F3 = new FrmHome()
                   F3.MdiParent = this;
                   F3.Dock = DockStyle.Fill;
                   F3.Show();
                   //
                   this.pnlCompositeCon.Controls.Clear();
                   this.pnlCompositeCon.Controls.Add(F3);
                   this.txtCurrentLoadedForm.Text = F3.Name.ToUpper();

                   break;
           }
       }

So i could have used the function

private void SelectTabToView(string sWhatTab)
       {
           switch (sWhatTab.ToUpper()) {
               case "HOME":
                   WhatFormToLoad(FrmHome);
                   break;
               case "BILLING":
                   WhatFormToLoad(FrmBilling);
                   break;
               case "INVENTORY":
                   WhatFormToLoad(FrmInventory);
                   break;
           }
       }


This is much easier than typing all those redundant settings Smile | :)

Thats why i have decide to create a generic routine or a form factory to catter the loading of forms by just passing the form name.

If im not on the right path in doing this please advice on what to do Smile | :)

Maybe i was just looking how to hammer a nail with a jackhammer Smile | :)
GeneralRe: need help or advice... Pin
Nader Elshehabi14-Oct-06 18:09
Nader Elshehabi14-Oct-06 18:09 
GeneralRe: need help or advice... Pin
TheCardinal14-Oct-06 18:45
TheCardinal14-Oct-06 18:45 
Questionhtml parsing Pin
kerrywes13-Oct-06 19:30
kerrywes13-Oct-06 19:30 
QuestionCreate controls form text file? Pin
greyzz13-Oct-06 16:20
greyzz13-Oct-06 16:20 
AnswerRe: Create controls form text file? Pin
Nader Elshehabi13-Oct-06 17:32
Nader Elshehabi13-Oct-06 17:32 
GeneralRe: Create controls form text file? Pin
greyzz13-Oct-06 18:20
greyzz13-Oct-06 18:20 
GeneralRe: Create controls form text file? Pin
Nader Elshehabi14-Oct-06 2:52
Nader Elshehabi14-Oct-06 2:52 
QuestionAutomatic capitalization in VS2003 ? Pin
digsy_13-Oct-06 11:30
digsy_13-Oct-06 11:30 
AnswerRe: Automatic capitalization in VS2003 ? Pin
Wjousts13-Oct-06 11:53
Wjousts13-Oct-06 11:53 
GeneralRe: Automatic capitalization in VS2003 ? Pin
digsy_13-Oct-06 12:06
digsy_13-Oct-06 12:06 
GeneralRe: Automatic capitalization in VS2003 ? Pin
Kevin McFarlane13-Oct-06 12:47
Kevin McFarlane13-Oct-06 12:47 
QuestionHandling encryption at the application level Pin
kennk13-Oct-06 11:16
kennk13-Oct-06 11:16 
QuestionI cannot establish a connection to pop3 server !!! Pin
mohadcs13-Oct-06 11:12
mohadcs13-Oct-06 11:12 
QuestionDoc File Display Pin
Syed Shahid Hussain13-Oct-06 10:58
Syed Shahid Hussain13-Oct-06 10:58 
AnswerRe: Doc File Display Pin
Nader Elshehabi13-Oct-06 12:35
Nader Elshehabi13-Oct-06 12:35 
GeneralRe: Doc File Display Pin
Syed Shahid Hussain13-Oct-06 20:38
Syed Shahid Hussain13-Oct-06 20:38 
Questioncreating prime events for a control Pin
Nadia Monalisa13-Oct-06 9:24
Nadia Monalisa13-Oct-06 9:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.