Промежуточное.
This commit is contained in:
parent
8666b365b0
commit
bf736e563d
52
VisualComponentsLib/UserDataGridView.Designer.cs
generated
52
VisualComponentsLib/UserDataGridView.Designer.cs
generated
@ -28,10 +28,58 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
dataGridView = new DataGridView();
|
||||
buttonAdd = new Button();
|
||||
buttonClear = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Location = new Point(3, 3);
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.RowTemplate.Height = 25;
|
||||
dataGridView.Size = new Size(417, 459);
|
||||
dataGridView.TabIndex = 0;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.Location = new Point(446, 23);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(123, 23);
|
||||
buttonAdd.TabIndex = 1;
|
||||
buttonAdd.Text = "Добавить значение";
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += ButtonAdd_Click;
|
||||
//
|
||||
// buttonClear
|
||||
//
|
||||
buttonClear.Location = new Point(446, 76);
|
||||
buttonClear.Name = "buttonClear";
|
||||
buttonClear.Size = new Size(123, 23);
|
||||
buttonClear.TabIndex = 2;
|
||||
buttonClear.Text = "Очистить всё";
|
||||
buttonClear.UseVisualStyleBackColor = true;
|
||||
buttonClear.Click += ButtonClear_Click;
|
||||
//
|
||||
// UserDataGridView
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Controls.Add(buttonClear);
|
||||
Controls.Add(buttonAdd);
|
||||
Controls.Add(dataGridView);
|
||||
Name = "UserDataGridView";
|
||||
Size = new Size(598, 465);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DataGridView dataGridView;
|
||||
private Button buttonAdd;
|
||||
private Button buttonClear;
|
||||
}
|
||||
}
|
||||
|
@ -12,9 +12,22 @@ namespace VisualComponentsLib
|
||||
{
|
||||
public partial class UserDataGridView : UserControl
|
||||
{
|
||||
|
||||
|
||||
public UserDataGridView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//полная очистка
|
||||
private void ButtonClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
dataGridView.Rows.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
|
36
VisualComponentsLib/UserTextBox.Designer.cs
generated
36
VisualComponentsLib/UserTextBox.Designer.cs
generated
@ -28,10 +28,42 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
checkBox = new CheckBox();
|
||||
textBox = new TextBox();
|
||||
SuspendLayout();
|
||||
//
|
||||
// checkBox
|
||||
//
|
||||
checkBox.AutoSize = true;
|
||||
checkBox.Location = new Point(14, 52);
|
||||
checkBox.Name = "checkBox";
|
||||
checkBox.Size = new Size(104, 19);
|
||||
checkBox.TabIndex = 0;
|
||||
checkBox.Text = "Включить null";
|
||||
checkBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// textBox
|
||||
//
|
||||
textBox.Location = new Point(14, 12);
|
||||
textBox.Name = "textBox";
|
||||
textBox.Size = new Size(182, 23);
|
||||
textBox.TabIndex = 2;
|
||||
//
|
||||
// UserTextBox
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Controls.Add(textBox);
|
||||
Controls.Add(checkBox);
|
||||
Name = "UserTextBox";
|
||||
Size = new Size(210, 80);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private CheckBox checkBox;
|
||||
private TextBox textBox;
|
||||
}
|
||||
}
|
||||
|
@ -12,9 +12,50 @@ namespace VisualComponentsLib
|
||||
{
|
||||
public partial class UserTextBox : UserControl
|
||||
{
|
||||
public string inputString
|
||||
{
|
||||
get => textBox.Text;
|
||||
set => textBox.Text = value;
|
||||
}
|
||||
|
||||
public new event EventHandler? TextChanged
|
||||
{
|
||||
add => textBox.Text = value.ToString();
|
||||
remove => textBox.Text = string.Empty;
|
||||
}
|
||||
|
||||
public UserTextBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void clickCheckBox()
|
||||
{
|
||||
if(checkBox.Checked)
|
||||
{
|
||||
textBox.ReadOnly = true;
|
||||
|
||||
inputString = string.Empty;
|
||||
|
||||
textBox.Text = string.Empty;
|
||||
}
|
||||
|
||||
if(!checkBox.Checked)
|
||||
{
|
||||
try
|
||||
{
|
||||
double support;
|
||||
|
||||
if (Double.TryParse(textBox.Text, out support))
|
||||
{
|
||||
inputString = textBox.Text;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Введённое значение не является вещественным числом.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
|
Loading…
x
Reference in New Issue
Block a user