дизззззззаааааааааааааааааайн

This commit is contained in:
the 2024-06-25 22:48:02 +04:00
parent 24ac6da8cc
commit 49853d94de
2 changed files with 76 additions and 34 deletions

View File

@ -34,57 +34,65 @@
buttonAdd = new Button();
buttonSelectFile = new Button();
labelFile = new Label();
groupBox1 = new GroupBox();
groupBoxControl = new GroupBox();
dataGridView = new DataGridView();
groupBox1 = new GroupBox();
label1 = new Label();
groupBoxFiles.SuspendLayout();
groupBox1.SuspendLayout();
groupBoxControl.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
groupBox1.SuspendLayout();
SuspendLayout();
//
// groupBoxFiles
//
groupBoxFiles.BackColor = Color.AliceBlue;
groupBoxFiles.Controls.Add(panelFiles);
groupBoxFiles.Dock = DockStyle.Left;
groupBoxFiles.Font = new Font("Segoe UI", 10F, FontStyle.Bold);
groupBoxFiles.Location = new Point(0, 0);
groupBoxFiles.Name = "groupBoxFiles";
groupBoxFiles.Size = new Size(282, 586);
groupBoxFiles.TabIndex = 0;
groupBoxFiles.TabStop = false;
groupBoxFiles.Text = "Фотографии";
groupBoxFiles.Text = "Фотографии выбранного товара";
//
// panelFiles
//
panelFiles.AutoScroll = true;
panelFiles.Dock = DockStyle.Fill;
panelFiles.Location = new Point(3, 19);
panelFiles.Location = new Point(3, 21);
panelFiles.Name = "panelFiles";
panelFiles.Size = new Size(276, 564);
panelFiles.Size = new Size(276, 562);
panelFiles.TabIndex = 0;
//
// comboBoxProduct
//
comboBoxProduct.FormattingEnabled = true;
comboBoxProduct.Location = new Point(19, 43);
comboBoxProduct.Location = new Point(72, 71);
comboBoxProduct.Name = "comboBoxProduct";
comboBoxProduct.Size = new Size(121, 23);
comboBoxProduct.Size = new Size(116, 25);
comboBoxProduct.TabIndex = 1;
comboBoxProduct.SelectedIndexChanged += comboBoxProduct_SelectedIndexChanged;
//
// buttonAdd
//
buttonAdd.Location = new Point(19, 92);
buttonAdd.BackColor = Color.FromArgb(192, 255, 192);
buttonAdd.ForeColor = SystemColors.ActiveCaptionText;
buttonAdd.Location = new Point(3, 160);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(75, 23);
buttonAdd.Size = new Size(92, 33);
buttonAdd.TabIndex = 2;
buttonAdd.Text = "Добавить";
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.UseVisualStyleBackColor = false;
buttonAdd.Click += buttonAdd_Click;
//
// buttonSelectFile
//
buttonSelectFile.Location = new Point(19, 237);
buttonSelectFile.ForeColor = SystemColors.ActiveCaptionText;
buttonSelectFile.Location = new Point(6, 102);
buttonSelectFile.Name = "buttonSelectFile";
buttonSelectFile.Size = new Size(109, 27);
buttonSelectFile.Size = new Size(89, 52);
buttonSelectFile.TabIndex = 3;
buttonSelectFile.Text = "Выбрать файл...";
buttonSelectFile.UseVisualStyleBackColor = true;
@ -93,51 +101,81 @@
// labelFile
//
labelFile.AutoSize = true;
labelFile.Location = new Point(19, 267);
labelFile.Location = new Point(114, 120);
labelFile.Name = "labelFile";
labelFile.Size = new Size(40, 15);
labelFile.Size = new Size(50, 19);
labelFile.TabIndex = 4;
labelFile.Text = "Пусто";
//
// groupBox1
// groupBoxControl
//
groupBox1.Controls.Add(comboBoxProduct);
groupBox1.Controls.Add(labelFile);
groupBox1.Controls.Add(buttonAdd);
groupBox1.Controls.Add(buttonSelectFile);
groupBox1.Dock = DockStyle.Right;
groupBox1.Location = new Point(678, 0);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(200, 586);
groupBox1.TabIndex = 5;
groupBox1.TabStop = false;
groupBox1.Text = "groupBox1";
groupBoxControl.BackColor = Color.Transparent;
groupBoxControl.Controls.Add(label1);
groupBoxControl.Controls.Add(comboBoxProduct);
groupBoxControl.Controls.Add(labelFile);
groupBoxControl.Controls.Add(buttonAdd);
groupBoxControl.Controls.Add(buttonSelectFile);
groupBoxControl.Dock = DockStyle.Right;
groupBoxControl.Font = new Font("Segoe UI", 10F, FontStyle.Bold);
groupBoxControl.ForeColor = SystemColors.ButtonFace;
groupBoxControl.Location = new Point(678, 0);
groupBoxControl.Name = "groupBoxControl";
groupBoxControl.Size = new Size(200, 586);
groupBoxControl.TabIndex = 5;
groupBoxControl.TabStop = false;
groupBoxControl.Text = "Элементы управления";
//
// dataGridView
//
dataGridView.BackgroundColor = Color.AliceBlue;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Dock = DockStyle.Fill;
dataGridView.Location = new Point(282, 0);
dataGridView.Location = new Point(3, 21);
dataGridView.Name = "dataGridView";
dataGridView.Size = new Size(396, 586);
dataGridView.Size = new Size(390, 562);
dataGridView.TabIndex = 6;
//
// groupBox1
//
groupBox1.BackColor = Color.Transparent;
groupBox1.Controls.Add(dataGridView);
groupBox1.Dock = DockStyle.Fill;
groupBox1.Font = new Font("Segoe UI", 10F, FontStyle.Bold);
groupBox1.ForeColor = SystemColors.ButtonHighlight;
groupBox1.Location = new Point(282, 0);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(396, 586);
groupBox1.TabIndex = 7;
groupBox1.TabStop = false;
groupBox1.Text = "Таблица со списком";
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(6, 74);
label1.Name = "label1";
label1.Size = new Size(54, 19);
label1.TabIndex = 5;
label1.Text = "Товар:";
//
// FormMediaFiles
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = Properties.Resources._9AZKH1_1911594361;
ClientSize = new Size(878, 586);
Controls.Add(dataGridView);
Controls.Add(groupBox1);
Controls.Add(groupBoxControl);
Controls.Add(groupBoxFiles);
Name = "FormMediaFiles";
Text = "FormMediaFiles";
Text = "Прикрепленные файлы";
Load += FormMediaFiles_Load;
Resize += FormMediaFiles_Resize;
groupBoxFiles.ResumeLayout(false);
groupBox1.ResumeLayout(false);
groupBox1.PerformLayout();
groupBoxControl.ResumeLayout(false);
groupBoxControl.PerformLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
groupBox1.ResumeLayout(false);
ResumeLayout(false);
}
@ -148,8 +186,10 @@
private Button buttonAdd;
private Button buttonSelectFile;
private Label labelFile;
private GroupBox groupBox1;
private GroupBox groupBoxControl;
private Panel panelFiles;
private DataGridView dataGridView;
private GroupBox groupBox1;
private Label label1;
}
}

View File

@ -40,6 +40,7 @@ namespace WinFormsApp
if (filelist != null)
{
dataGridView.DataSource = filelist;
dataGridView.Columns["ProductId"].Visible = false;
}
}
catch (Exception ex)
@ -63,7 +64,7 @@ namespace WinFormsApp
Image image = Image.FromStream(ms);
imageBox.Image = image;
}
imageBox.Width = groupBox1.Width;
imageBox.Width = groupBoxControl.Width;
panelFiles.Controls.Add(imageBox);
imageBox.SizeMode = PictureBoxSizeMode.Zoom;
imageBox.Height = 400;
@ -81,6 +82,7 @@ namespace WinFormsApp
private void FormMediaFiles_Load(object sender, EventArgs e)
{
dataGridView.DefaultCellStyle.ForeColor = Color.Black;
try
{
var list = _productLogic.ReadList(null);