0
My code is
public partial class TelaInicio : MetroFramework.Forms.MetroForm
{
internal ExibirDados exibirdados = null;
public TelaInicio(ExibirDados exibirdados)
{
InitializeComponent();
this.exibirdados = exibirdados;
}
I’m trying to instantiate the form ExibirDados
in form TelaInicio
class Exbirdados
public partial class ExibirDados : MetroFramework.Forms.MetroForm
{
public ExibirDados()
{
InitializeComponent();
}
}
And I get the following mistake
'C_buscadinamica.Telainicio' does not contain a constructor that takes 0 Arguments
The error itself is shown in the Program.cs
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
new SplashScreen().ShowDialog();
Application.Run(new TelaInicio()); //aqui ocorre o erro
}
}
How can I fix this? Why does this happen? Why do we need a constructor with zero arguments?
I removed my answer, yours is more complete :-) +1
– Renan