Unable to dynamically unload controls from host object

Apr 27, 2009 at 9:07 PM
I'm having a lot of problems getting a custom control with a base of FluidControl to unload from the Host control. 

I tried the following but it neither cleared the host control, nor did it reinstantiate the login control (base of FluidControl). 

        void miLogOut_Click(object sender, EventArgs e)
        {
            this.Controls.Clear();
            this.Controls.Add(this.Host);
            SetUser(string.Empty);
            lc = new MobileApp.Controls.LoginControl(this);
            lc.ClearControl();
            lc.UserLoggedInEvent += new MobileApp.Controls.LoginControl.UserLoggedIn(lc_UserLoggedInEvent);
            lc.ShowMaximized();
        }

I'm not sure what I'm doing wrong here, but it doesn't seem to react properly when calling control.add and control.remove.

Any tips?