1
I have the following Usercontrol :
public partial class SliderChrome : UserControl
{
private int _min;
public int Min
{
get { return _min; }
set
{
txtmin.Text = _min.ToString();
}
}
}
I use this Usercontrol in the Form as follows:
public partial class MacroForm : Form
{
private void ValorMinEMaxParametros(bool isEnglish, int Min, int Max)
{
DialogResult dialogResult;
if (isEnglish)
{
dialogResult = MessageBox.Show("Do you...", "Max ...", MessageBoxButtons.YesNo);
}
else
{
dialogResult = MessageBox.Show("Deseja...", "Max ...", MessageBoxButtons.YesNo);
}
if (dialogResult == DialogResult.Yes)
{
sliderChrome1.Min = Min;
sliderChrome1.Max = Max;
}
else if (dialogResult == DialogResult.No)
{
sliderChrome1.Min = 0;
sliderChrome1.Max = 1;
sliderChrome1.txtMin.Focus(); //Erro
}
}
}
I would like to set Focus in Textbox txtmin Usercontrol. How do I ?
Instead of
sliderChrome1.txtMin.Focus();
, if you dosliderChrome1.txtMin.Select();
also doesn’t work?– igventurelli