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 on 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 the Focus in the TextBox txtmin of the UserControl. How do I?