Click here to Skip to main content
15,915,501 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error message that doesn't go away Pin
Dave Kreskowiak25-Mar-04 1:15
mveDave Kreskowiak25-Mar-04 1:15 
GeneralRe: Error message that doesn't go away Pin
Heath Stewart25-Mar-04 4:38
protectorHeath Stewart25-Mar-04 4:38 
GeneralUrgent :remoting callbacks Pin
rana7424-Mar-04 22:06
rana7424-Mar-04 22:06 
GeneralRe: Urgent :remoting callbacks Pin
Heath Stewart25-Mar-04 4:21
protectorHeath Stewart25-Mar-04 4:21 
GeneralAsynchronous Network Transfer Pin
sibish n b24-Mar-04 22:04
sibish n b24-Mar-04 22:04 
GeneralGenerate a Diagram from a Database, algorithms, approaches, tips... Pin
Braulio Dez24-Mar-04 21:12
Braulio Dez24-Mar-04 21:12 
Generalc# forms Pin
DougW4824-Mar-04 18:56
DougW4824-Mar-04 18:56 
GeneralRe: c# forms Pin
Heath Stewart24-Mar-04 20:16
protectorHeath Stewart24-Mar-04 20:16 
In a very simplistic manner, assume two control classes (or even two instances of the same control class): UserControl1 and UserControl2, both to be exclusively hosted by MainForm:
public class MainForm : Form
{
  private UserControl1 uc1; // Both instantiated/initialized elsewhere.
  private UserControl2 uc2;
  //...
 
  // Completely made-up for example
  private void Next()
  {
    Controls.Remove(uc1);
    Controls.Add(uc2);
  }
}
Remove one and add the other. This won't create or dispose the instances, just remove them from the collection of child controls for that container (and they can be parented only to one container as with all windows).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: c# forms Pin
DougW4825-Mar-04 0:02
DougW4825-Mar-04 0:02 
GeneralRe: c# forms Pin
Heath Stewart25-Mar-04 3:56
protectorHeath Stewart25-Mar-04 3:56 
GeneralRich Text Box (Visual c#.net) Pin
naresh_pandey1324-Mar-04 18:53
naresh_pandey1324-Mar-04 18:53 
GeneralRe: Rich Text Box (Visual c#.net) Pin
OmegaSupreme25-Mar-04 5:24
OmegaSupreme25-Mar-04 5:24 
GeneralRe: Rich Text Box (Visual c#.net) Pin
naresh_pandey1326-Mar-04 1:59
naresh_pandey1326-Mar-04 1:59 
GeneralRich Text Box Pin
naresh_pandey1324-Mar-04 18:51
naresh_pandey1324-Mar-04 18:51 
GeneralSmart Build Pin
blackthunder00124-Mar-04 18:09
blackthunder00124-Mar-04 18:09 
GeneralRe: Smart Build Pin
Heath Stewart24-Mar-04 20:11
protectorHeath Stewart24-Mar-04 20:11 
GeneralRe: Smart Build Pin
blackthunder00124-Mar-04 23:42
blackthunder00124-Mar-04 23:42 
GeneralRe: Smart Build Pin
Heath Stewart25-Mar-04 4:02
protectorHeath Stewart25-Mar-04 4:02 
GeneralDataGrid Control Question Pin
DougW4824-Mar-04 16:54
DougW4824-Mar-04 16:54 
GeneralRe: DataGrid Control Question Pin
ian mariano24-Mar-04 17:28
ian mariano24-Mar-04 17:28 
GeneralRe: DataGrid Control Question Pin
Heath Stewart24-Mar-04 17:31
protectorHeath Stewart24-Mar-04 17:31 
Questiongetting mouse position? Pin
azusakt24-Mar-04 16:29
azusakt24-Mar-04 16:29 
AnswerRe: getting mouse position? Pin
Heath Stewart24-Mar-04 17:24
protectorHeath Stewart24-Mar-04 17:24 
QuestionHow can I save an icon? Pin
Flack24-Mar-04 14:40
Flack24-Mar-04 14:40 
AnswerRe: How can I save an icon? Pin
Heath Stewart24-Mar-04 17:21
protectorHeath Stewart24-Mar-04 17:21 

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.