diff --git a/KOP_Labs/KOP_Labs.sln b/KOP_Labs/KOP_Labs.sln new file mode 100644 index 0000000..d516f77 --- /dev/null +++ b/KOP_Labs/KOP_Labs.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35208.52 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomComponents", "KOP_Labs\CustomComponents.csproj", "{30670FC3-546A-4837-8A6C-48D6A479F5CA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {30670FC3-546A-4837-8A6C-48D6A479F5CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {30670FC3-546A-4837-8A6C-48D6A479F5CA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {30670FC3-546A-4837-8A6C-48D6A479F5CA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {30670FC3-546A-4837-8A6C-48D6A479F5CA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A7ACB90F-E6F4-4A35-AC69-49382F7C8CD0} + EndGlobalSection +EndGlobal diff --git a/KOP_Labs/KOP_Labs/Class1.cs b/KOP_Labs/KOP_Labs/Class1.cs new file mode 100644 index 0000000..617379a --- /dev/null +++ b/KOP_Labs/KOP_Labs/Class1.cs @@ -0,0 +1,6 @@ +namespace KOP_Labs +{ + public class Class1 + { + } +} diff --git a/KOP_Labs/KOP_Labs/CustomComboBox.Designer.cs b/KOP_Labs/KOP_Labs/CustomComboBox.Designer.cs new file mode 100644 index 0000000..a379d1a --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomComboBox.Designer.cs @@ -0,0 +1,56 @@ +namespace KOP_Labs +{ + partial class CustomComboBox + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + textBox1 = new TextBox(); + SuspendLayout(); + // + // textBox1 + // + textBox1.Location = new Point(13, 55); + textBox1.Name = "textBox1"; + textBox1.Size = new Size(289, 27); + textBox1.TabIndex = 0; + // + // CustomListBox + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(textBox1); + Name = "CustomListBox"; + Size = new Size(321, 183); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private TextBox textBox1; + } +} diff --git a/KOP_Labs/KOP_Labs/CustomComboBox.cs b/KOP_Labs/KOP_Labs/CustomComboBox.cs new file mode 100644 index 0000000..9c71764 --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomComboBox.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace KOP_Labs +{ + public partial class CustomComboBox : UserControl + { + public CustomComboBox() + { + InitializeComponent(); + } + } +} diff --git a/KOP_Labs/KOP_Labs/CustomComboBox.resx b/KOP_Labs/KOP_Labs/CustomComboBox.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomComboBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/KOP_Labs/KOP_Labs/CustomComponents.csproj b/KOP_Labs/KOP_Labs/CustomComponents.csproj new file mode 100644 index 0000000..060aa1c --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomComponents.csproj @@ -0,0 +1,10 @@ + + + + net6.0-windows + enable + true + enable + + + diff --git a/KOP_Labs/KOP_Labs/CustomListBox.Designer.cs b/KOP_Labs/KOP_Labs/CustomListBox.Designer.cs new file mode 100644 index 0000000..15b6e49 --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomListBox.Designer.cs @@ -0,0 +1,57 @@ +namespace KOP_Labs +{ + partial class CustomListBox + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + checkedListBox = new CheckedListBox(); + SuspendLayout(); + // + // checkedListBox + // + checkedListBox.FormattingEnabled = true; + checkedListBox.Location = new Point(3, 16); + checkedListBox.Name = "checkedListBox"; + checkedListBox.Size = new Size(214, 180); + checkedListBox.TabIndex = 0; + checkedListBox.SelectedIndexChanged += this.checkedListBox_SelectedIndexChanged; + // + // CustomListBox + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(checkedListBox); + Name = "CustomListBox"; + Size = new Size(220, 223); + ResumeLayout(false); + } + + #endregion + + private CheckedListBox checkedListBox; + } +} diff --git a/KOP_Labs/KOP_Labs/CustomListBox.cs b/KOP_Labs/KOP_Labs/CustomListBox.cs new file mode 100644 index 0000000..c97f9b5 --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomListBox.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace KOP_Labs +{ + public partial class CustomListBox : UserControl + { + public CustomListBox() + { + InitializeComponent(); + } + private EventHandler _changeEvent; + + private void checkedListBox_SelectedIndexChanged(object sender, EventArgs e) + { + _changeEvent?.Invoke(sender, e); + } + + public event EventHandler ChangeEvent + { + add + { + _changeEvent += value; + } + remove + { + _changeEvent -= value; + } + + } + public void Clear() + { + checkedListBox.Items.Clear(); + } + public void AddToList(string Value) + { + if (Value == null) + { + return; + } + checkedListBox.Items.Add(Value); + } + public string SelectedElement + { + get + { + return (checkedListBox.SelectedIndex > -1 && checkedListBox.GetItemChecked(checkedListBox.SelectedIndex)) ? checkedListBox.SelectedItem.ToString() : string.Empty; + } + set + { + if (checkedListBox.Items.Contains(value)) { + checkedListBox.SelectedItem = value; + } + } + } + } +} diff --git a/KOP_Labs/KOP_Labs/CustomListBox.resx b/KOP_Labs/KOP_Labs/CustomListBox.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomListBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/KOP_Labs/KOP_Labs/CustomTree.Designer.cs b/KOP_Labs/KOP_Labs/CustomTree.Designer.cs new file mode 100644 index 0000000..dd0a172 --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomTree.Designer.cs @@ -0,0 +1,55 @@ +namespace KOP_Labs +{ + partial class CustomTree + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + treeView1 = new TreeView(); + SuspendLayout(); + // + // treeView1 + // + treeView1.Location = new Point(3, 3); + treeView1.Name = "treeView1"; + treeView1.Size = new Size(360, 425); + treeView1.TabIndex = 0; + // + // CustomTree + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(treeView1); + Name = "CustomTree"; + Size = new Size(366, 431); + ResumeLayout(false); + } + + #endregion + + private TreeView treeView1; + } +} diff --git a/KOP_Labs/KOP_Labs/CustomTree.cs b/KOP_Labs/KOP_Labs/CustomTree.cs new file mode 100644 index 0000000..73bfcf3 --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomTree.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace KOP_Labs +{ + public partial class CustomTree : UserControl + { + public CustomTree() + { + InitializeComponent(); + } + } +} diff --git a/KOP_Labs/KOP_Labs/CustomTree.resx b/KOP_Labs/KOP_Labs/CustomTree.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/KOP_Labs/KOP_Labs/CustomTree.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file