Well, CustomForm
and CustomCode
are different things. CustomCode
is typically used to evoke internal functions that execute a piece of code and which in turn can call an inner functions that show a form. In this case it is to do as below.
public class FuncaoUtilizadorFrmTeste : CustomCode
{
FrmTeste ttt = new FrmTeste();
ttt.ShowDialog();
}
CustomForm is used to call a user form directly, that is, any form that inherits from CustomForm
instead of Form
. These forms appear inside the shell.
Conclusion, you are not to use the two mixed concepts, CustomForm
should be used directly in the form:
public partial class FrmTeste : CustomForm
{
public FrmTeste()
{
InitializeComponent();
}
}
CustomCode
should be used directly in classes.
{
public class CustomCodeSample: CustomCode
{
public void ShowMyForm()
{
FrmTeste entityCreator = new frmEntityCreator();
entityCreator.ShowDialog();
}
}
}
Example in Git link