60 lines
1.7 KiB
C#
Raw Normal View History

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();
FillGrid();
2024-09-05 21:27:41 +04:00
}
private void FillBox()
{
2024-09-05 23:14:57 +04:00
controlComboBox.elements = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4";
}
private void FillTextBox()
{
controlTextBox.text = "+79063908075";
2024-09-05 21:27:41 +04:00
}
private void FillGrid()
{
List<string> headers = new List<string>() { "Id", "<22><><EFBFBD>" };
List<int> width = new List<int>() { 200, 200 };
List<bool> isVisible = new List<bool>() { true, true };
List<string> props = new List<string>() { "Id", "Name" };
controlDataGrid.CreateColumns(2, headers, width, isVisible, props);
}
2024-09-05 21:27:41 +04:00
private void controlComboBox_ComboBoxChanged(object sender, EventArgs e)
{
2024-09-05 23:14:57 +04:00
var elem = controlComboBox.elements;
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
}
private void buttonGetObj_Click(object sender, EventArgs e)
{
var da = controlDataGrid.GetObject<Person>();
MessageBox.Show($"{da?.Id}:{da?.Name} ");
}
private void buttonClear_Click(object sender, EventArgs e)
{
controlDataGrid.ClearData();
}
2024-09-05 21:27:41 +04:00
}
}