-3
Manipulating UserControl
(s) you can create an inherited object from Control
. So, create your form in this UserControl
and make it work as a Form.
After that, create a Panel
client who will display the pages, and declare the controls as in the example below:
public UserControlHome ucHome = new UserControlHome();
public UserControlCripto ucCripto = new UserControlCripto();
And create this method to change the Control
who is in the Panel
client conteudo
:
public void AlterarConteudo(ref Control controle) {
// considere 'conteudo' o Panel que irá ter os controles dentro
conteudo.Controls.Clear(); // - remove os controles dentro do Panel
{ // altera propriedades do controle que irá ser colocado
controle.Dock = DockStyle.Fill;
}
// adiciona o controle ao cliente
conteudo.Controls.Add(controle);
}
And when you click the Encryption button, call the method with the expression:
AlterarConteudo(ref ucCripto);
And to the Home button:
AlterarConteudo(ref ucHome);
Remember to implement a method to save information to the controls while being discarded.
you can use a tabControl, or open the other Forms within that main
– Rovann Linhalis