B
Bart
Dear all,
I have a problem that I cannot understand the reason of.
My code is
private void ButtDetl_Click(object sender, System.EventArgs e)
{
// give an information of the sender
int num=this.GetNumber(((Button)sender).Name);
//check if there is a TextBox with same number of the sender after
"TextExpl"
foreach (Control c in this.Controls)
{
if (c.GetType().Name=="TextBox"&&c.Name=="TreeExpl"+num.ToString())
// setup the DtBox
this.DtBox=(TextBox)c;
}
//insert Explanation Form if DtBox is not null
this.InsExplanation(DtBox);
}
Sometimes the line
this.InsExplanation(DtBox);
is done three or four times without a reason, inserting the same Explanation
Form (in my case) three or four times!!! Furthermore when I open my
application the Application_Load(object sender, System.EventArgs e) is
repeted 2 times.
Any suggestion?
Thank you,
Bart
I have a problem that I cannot understand the reason of.
My code is
private void ButtDetl_Click(object sender, System.EventArgs e)
{
// give an information of the sender
int num=this.GetNumber(((Button)sender).Name);
//check if there is a TextBox with same number of the sender after
"TextExpl"
foreach (Control c in this.Controls)
{
if (c.GetType().Name=="TextBox"&&c.Name=="TreeExpl"+num.ToString())
// setup the DtBox
this.DtBox=(TextBox)c;
}
//insert Explanation Form if DtBox is not null
this.InsExplanation(DtBox);
}
Sometimes the line
this.InsExplanation(DtBox);
is done three or four times without a reason, inserting the same Explanation
Form (in my case) three or four times!!! Furthermore when I open my
application the Application_Load(object sender, System.EventArgs e) is
repeted 2 times.
Any suggestion?
Thank you,
Bart