i have a problem setting the FOCUS event on my NUMERICUPDOWN control..
My program initially sets the numericupdown.enabled property to false with the following code:
for (int i = 1; i < 10; i++)
{
NumericUpDown nud = (NumericUpDown)FindForm().Controls.Find("talla_n" + i, true)[0];
nud.Enabled = false;
}
Later after doing some actions, it set the property to true again.
for (int i = 1; i < 10; i++)
{
NumericUpDown nud = (NumericUpDown)FindForm().Controls.Find("talla_n" + i, true)[0];
nud.Enabled = true;
}
After that, i use the focus function:
NumericUpDown nud = (NumericUpDown)FindForm().Controls.Find("talla_n1", true)[0];
bool focused = nud.Focus();
But it always returns FALSE after the FOCUS Function.
Console.WriteLine(focused); // always returns false
I've turn the TabStop = true and Enabled = true, so i dont know whats the problem..
This is my code for Designer
//
// talla_n1
//
this.talla_n1.Location = new System.Drawing.Point(73, 64);
this.talla_n1.Name = "talla_n1";
this.talla_n1.Size = new System.Drawing.Size(41, 22);
this.talla_n1.TabIndex = 18;
this.talla_n1.Tag = "talla_n1";
this.talla_n1.TabStop = true;
this.talla_n1.Enabled = true;
this.talla_n1.ValueChanged += new System.EventHandler(this.textChanged_Numeracion_EventHandler);
this.talla_n1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.talla_n1_KeyDown);