2024-09-05 21:27:41 +04:00
|
|
|
|
namespace Forms
|
|
|
|
|
{
|
|
|
|
|
public partial class Form : System.Windows.Forms.Form
|
|
|
|
|
{
|
|
|
|
|
public Form()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
FillBox();
|
2024-09-05 23:14:57 +04:00
|
|
|
|
FillTextBox();
|
2024-09-21 20:18:23 +04:00
|
|
|
|
FillList();
|
2024-09-05 21:27:41 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FillBox()
|
|
|
|
|
{
|
2024-09-06 17:40:13 +04:00
|
|
|
|
controlComboBox.ComboBoxItems.Add("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1");
|
|
|
|
|
controlComboBox.ComboBoxItems.Add("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2");
|
|
|
|
|
controlComboBox.ComboBoxItems.Add("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3");
|
|
|
|
|
controlComboBox.ComboBoxItems.Add("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4");
|
|
|
|
|
controlComboBox.SelectedItem = "dafafadsf";
|
2024-09-05 23:14:57 +04:00
|
|
|
|
}
|
|
|
|
|
private void FillTextBox()
|
|
|
|
|
{
|
2024-09-06 17:40:13 +04:00
|
|
|
|
controlTextBox.NumPattern = @"^\+7\d{10}$";
|
2024-09-05 23:14:57 +04:00
|
|
|
|
controlTextBox.text = "+79063908075";
|
2024-09-05 21:27:41 +04:00
|
|
|
|
}
|
2024-09-21 20:18:23 +04:00
|
|
|
|
private void FillList()
|
2024-09-06 01:06:10 +04:00
|
|
|
|
{
|
2024-09-21 20:18:23 +04:00
|
|
|
|
controlListBox.SetTemplateString("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [Name] [Surname]", "[", "]");
|
|
|
|
|
controlListBox.FillProp<Person>(new Person(1, "<22><><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), 0, "Name");
|
|
|
|
|
controlListBox.FillProp<Person>(new Person(2, "<22><><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), 4, "Surname");
|
2024-09-06 01:06:10 +04:00
|
|
|
|
}
|
2024-09-05 21:27:41 +04:00
|
|
|
|
|
|
|
|
|
private void controlComboBox_ComboBoxChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-09-06 17:40:13 +04:00
|
|
|
|
var elem = controlComboBox.SelectedItem;
|
2024-09-05 23:14:57 +04:00
|
|
|
|
MessageBox.Show($"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: {elem}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void controlTextBox_CheckBoxChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (controlTextBox.text == null)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show($"CheckBox checked");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show($"CheckBox not checked");
|
|
|
|
|
}
|
2024-09-05 21:27:41 +04:00
|
|
|
|
}
|
2024-09-06 01:06:10 +04:00
|
|
|
|
|
|
|
|
|
private void buttonGetObj_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-09-21 20:18:23 +04:00
|
|
|
|
var obj = controlListBox.GetSelectedObject<Person>();
|
|
|
|
|
MessageBox.Show($"{obj.Name} {obj.Surname}");
|
2024-09-06 01:06:10 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonClear_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-09-21 20:18:23 +04:00
|
|
|
|
//controlDataGrid.ClearData();
|
2024-09-06 01:06:10 +04:00
|
|
|
|
}
|
2024-09-06 17:40:13 +04:00
|
|
|
|
|
|
|
|
|
private void buttonEnter_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var val = controlTextBox.text;
|
|
|
|
|
MessageBox.Show($"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> {val}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonAdd_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-09-21 20:18:23 +04:00
|
|
|
|
//controlDataGrid.SetData<Person>(new Person(1, "asdasdas", "asdasd1asd"), 2, 3);
|
2024-09-06 17:40:13 +04:00
|
|
|
|
}
|
2024-09-05 21:27:41 +04:00
|
|
|
|
}
|
|
|
|
|
}
|