Changing panels in settings RRS feed

  • Question

  • I have a dialog in the settings part of WHSConsole.  But under certain circumstances, I would like to display a different panel.  I do it this way:

    public HomeServerSettingsExtender(int width, int height, IConsoleServices consoleServices)
            this.consoleServices = consoleServices;
            myTabControl = new SettingsTabUserControl(width, height, consoleServices);        
            if (myTabControl.bInitFailed)
                  myTabControl2 = new ConfigureTabUserControl();

    This works and displays myTabControl2 if there's an error condition raised on the first "panel" (myTabControl dialog).

    What i'm trying to do though, is to display the original myTabControl dialog after the user has responded to something on the myTabControl2.

    There's code in here that responds to the "TabControl" request, which I modified to return the control I want displayed:

    public Control TabControl
               if ( ThereWas An Error )
                     return myTabControl2;
                     return myTabControl;

    How can I make WHS call this function again (I want to trigger this call from myTabControl2 when the user has responded to something)?  After the user responds to myTabControl2, I want the system to display myTabContol again.  I thought if by setting "There was an Error" to false, I could get it to display the other panel.  But I can't get it to call this function again.

    There is probably a much better way to do this - I just can't think of it... :)

    Thanks in advance...



    Tuesday, April 6, 2010 5:49 PM

All replies

  • I think you're not going to be able to do what you want that way. I believe you'll have to render your tab control differently depending on whether there's an error to be handled, not set up an entirely different control.
    I'm not on the WHS team, I just post a lot. :)
    Tuesday, April 6, 2010 7:18 PM
  • Waah!

    I did get around the problem though, by using one panel and hiding/showing different controls.  Thanks for the quick response.

    Tuesday, April 6, 2010 11:56 PM