Details
form doesn't show anything even when it is called from the Welcome
form.
here's all the code (its like login-signup project):
Details Form
namespace D
{
public partial class Details : Form
{
public string dtext1;
public string orform = string.Empty;
public string orform2 = string.Empty;
public string orform3 = string.Empty;
public string orform4 = string.Empty;
public Details(string incomform,string incomform2,string incomform3,string incomform4)
{
InitializeComponent();
orform = incomform;
orform2 = incomform2;
orform3 = incomform3;
orform4 = incomform4;
}
public Details()
{
}
private void Details_Load(object sender, EventArgs e)
{
textBox1.Text = orform;
textBox2.Text = orform2;
textBox3.Text = orform3;
textBox4.Text = orform4;
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
Welcome Form
namespace D
{
public partial class Welcome : Form
{
public Welcome()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Details Det = new Details();
Det.ShowDialog();
this.Close();
}
}
}
any help/advice would be really a big legit help
The problem is with your Details
form constructor that you didn't call InitializeComponent();
in it. Change it to this:
public Details()
{
InitializeComponent();
}
All designer generated codes including your controls definition and properties and layout is in InitializeComponent
and it should be called in your form the constructor to add controls to your form and perform layout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With