Browse Source

commit: UI adjust

HOME 4 years ago
parent
commit
e45ec484d1

+ 14 - 5
ISCSIConsole/AddTargetForm.Designer.cs

@@ -45,6 +45,7 @@ namespace ISCSIConsole
             // 
             // btnAddDiskImage
             // 
+            this.btnAddDiskImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnAddDiskImage.Location = new System.Drawing.Point(340, 73);
             this.btnAddDiskImage.Name = "btnAddDiskImage";
             this.btnAddDiskImage.Size = new System.Drawing.Size(140, 23);
@@ -55,6 +56,7 @@ namespace ISCSIConsole
             // 
             // btnAddPhysicalDisk
             // 
+            this.btnAddPhysicalDisk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnAddPhysicalDisk.Location = new System.Drawing.Point(340, 102);
             this.btnAddPhysicalDisk.Name = "btnAddPhysicalDisk";
             this.btnAddPhysicalDisk.Size = new System.Drawing.Size(140, 23);
@@ -66,6 +68,8 @@ namespace ISCSIConsole
             // 
             // txtTargetIQN
             // 
+            this.txtTargetIQN.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
             this.txtTargetIQN.Location = new System.Drawing.Point(57, 12);
             this.txtTargetIQN.Name = "txtTargetIQN";
             this.txtTargetIQN.Size = new System.Drawing.Size(275, 21);
@@ -91,7 +95,8 @@ namespace ISCSIConsole
             // 
             // btnOK
             // 
-            this.btnOK.Location = new System.Drawing.Point(324, 200);
+            this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnOK.Location = new System.Drawing.Point(324, 194);
             this.btnOK.Name = "btnOK";
             this.btnOK.Size = new System.Drawing.Size(75, 23);
             this.btnOK.TabIndex = 8;
@@ -101,8 +106,9 @@ namespace ISCSIConsole
             // 
             // btnCancel
             // 
+            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-            this.btnCancel.Location = new System.Drawing.Point(405, 200);
+            this.btnCancel.Location = new System.Drawing.Point(405, 194);
             this.btnCancel.Name = "btnCancel";
             this.btnCancel.Size = new System.Drawing.Size(75, 23);
             this.btnCancel.TabIndex = 9;
@@ -112,6 +118,9 @@ namespace ISCSIConsole
             // 
             // listDisks
             // 
+            this.listDisks.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
             this.listDisks.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
             this.columnDescription,
             this.columnSize});
@@ -137,6 +146,7 @@ namespace ISCSIConsole
             // 
             // btnAddVolume
             // 
+            this.btnAddVolume.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnAddVolume.Location = new System.Drawing.Point(340, 131);
             this.btnAddVolume.Name = "btnAddVolume";
             this.btnAddVolume.Size = new System.Drawing.Size(140, 23);
@@ -148,6 +158,7 @@ namespace ISCSIConsole
             // 
             // btnCreateDiskImage
             // 
+            this.btnCreateDiskImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnCreateDiskImage.Location = new System.Drawing.Point(340, 44);
             this.btnCreateDiskImage.Name = "btnCreateDiskImage";
             this.btnCreateDiskImage.Size = new System.Drawing.Size(140, 23);
@@ -158,6 +169,7 @@ namespace ISCSIConsole
             // 
             // btnRemove
             // 
+            this.btnRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnRemove.Enabled = false;
             this.btnRemove.Location = new System.Drawing.Point(340, 160);
             this.btnRemove.Name = "btnRemove";
@@ -184,10 +196,7 @@ namespace ISCSIConsole
             this.Controls.Add(this.txtTargetIQN);
             this.Controls.Add(this.btnAddPhysicalDisk);
             this.Controls.Add(this.btnAddDiskImage);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
             this.KeyPreview = true;
-            this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(500, 260);
             this.MinimumSize = new System.Drawing.Size(500, 260);
             this.Name = "AddTargetForm";
             this.ShowInTaskbar = false;

+ 2 - 2
ISCSIConsole/CreateDiskImageForm.Designer.cs

@@ -110,9 +110,9 @@ namespace ISCSIConsole
             // 
             // ImageFileButton
             // 
-            this.ImageFileButton.Location = new System.Drawing.Point(397, 35);
+            this.ImageFileButton.Location = new System.Drawing.Point(397, 37);
             this.ImageFileButton.Name = "ImageFileButton";
-            this.ImageFileButton.Size = new System.Drawing.Size(75, 23);
+            this.ImageFileButton.Size = new System.Drawing.Size(75, 21);
             this.ImageFileButton.TabIndex = 5;
             this.ImageFileButton.Text = "Browse..";
             this.ImageFileButton.UseVisualStyleBackColor = true;

+ 5 - 4
ISCSIConsole/CreateRAMDiskForm.Designer.cs

@@ -77,7 +77,7 @@ namespace ISCSIConsole
             // 
             // btnOK
             // 
-            this.btnOK.Location = new System.Drawing.Point(326, 187);
+            this.btnOK.Location = new System.Drawing.Point(316, 185);
             this.btnOK.Name = "btnOK";
             this.btnOK.Size = new System.Drawing.Size(75, 23);
             this.btnOK.TabIndex = 6;
@@ -88,7 +88,7 @@ namespace ISCSIConsole
             // btnCancel
             // 
             this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-            this.btnCancel.Location = new System.Drawing.Point(407, 187);
+            this.btnCancel.Location = new System.Drawing.Point(397, 185);
             this.btnCancel.Name = "btnCancel";
             this.btnCancel.Size = new System.Drawing.Size(75, 23);
             this.btnCancel.TabIndex = 7;
@@ -121,17 +121,18 @@ namespace ISCSIConsole
             // BaseOnCheckBox
             // 
             this.BaseOnCheckBox.AutoSize = true;
+            this.BaseOnCheckBox.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
             this.BaseOnCheckBox.Location = new System.Drawing.Point(14, 44);
             this.BaseOnCheckBox.Name = "BaseOnCheckBox";
             this.BaseOnCheckBox.Size = new System.Drawing.Size(66, 16);
             this.BaseOnCheckBox.TabIndex = 10;
             this.BaseOnCheckBox.Text = "BaseOn:";
+            this.BaseOnCheckBox.TextAlign = System.Drawing.ContentAlignment.TopLeft;
             this.BaseOnCheckBox.UseVisualStyleBackColor = true;
             this.BaseOnCheckBox.CheckedChanged += new System.EventHandler(this.BaseOnCheckBox_CheckedChanged);
             // 
             // ImageFileButton
             // 
-            this.ImageFileButton.Enabled = false;
             this.ImageFileButton.Location = new System.Drawing.Point(397, 40);
             this.ImageFileButton.Name = "ImageFileButton";
             this.ImageFileButton.Size = new System.Drawing.Size(75, 23);
@@ -176,11 +177,11 @@ namespace ISCSIConsole
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.CancelButton = this.btnCancel;
             this.ClientSize = new System.Drawing.Size(484, 211);
+            this.Controls.Add(this.BaseOnCheckBox);
             this.Controls.Add(this.DiskInfiValueLabel);
             this.Controls.Add(this.DiskInfoLabel);
             this.Controls.Add(this.ImageFileButton);
             this.Controls.Add(this.ImageFileTextBox);
-            this.Controls.Add(this.BaseOnCheckBox);
             this.Controls.Add(this.GbRadioButton);
             this.Controls.Add(this.MbRadioButton);
             this.Controls.Add(this.btnCancel);

+ 5 - 4
ISCSIConsole/CreateRAMDiskForm.cs

@@ -1,8 +1,8 @@
 using DiskAccessLibrary;
 using DiskAccessLibrary.Mod;
+using ISCSIConsole.Mods;
 using System;
 using System.Windows.Forms;
-using ISCSIConsole.Mods;
 
 namespace ISCSIConsole
 {
@@ -22,12 +22,13 @@ namespace ISCSIConsole
         private void BaseOnCheckBox_CheckedChanged(object sender, EventArgs e)
         {
             ImageFileTextBox.Enabled = BaseOnCheckBox.Checked;
-            ImageFileButton.Enabled = BaseOnCheckBox.Checked;
         }
 
         private void ImageFileButton_Click(object sender, EventArgs e)
         {
-            DialogResult result = openDiskImageDialog.ShowDialog();
+            if (false == BaseOnCheckBox.Checked) BaseOnCheckBox.Checked = true;
+
+            var result = openDiskImageDialog.ShowDialog();
             if (result == DialogResult.OK)
             {
                 ImageFileTextBox.Text = openDiskImageDialog.FileName;
@@ -138,4 +139,4 @@ namespace ISCSIConsole
 
         public Disk RAMDisk { get; private set; }
     }
-}
+}

+ 6 - 4
ISCSIConsole/MainForm.Designer.cs

@@ -90,6 +90,7 @@ namespace ISCSIConsole
             // 
             // btnAddTarget
             // 
+            this.btnAddTarget.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnAddTarget.Location = new System.Drawing.Point(354, 57);
             this.btnAddTarget.Name = "btnAddTarget";
             this.btnAddTarget.Size = new System.Drawing.Size(106, 23);
@@ -109,6 +110,7 @@ namespace ISCSIConsole
             // 
             // btnRemoveTarget
             // 
+            this.btnRemoveTarget.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnRemoveTarget.Enabled = false;
             this.btnRemoveTarget.Location = new System.Drawing.Point(354, 86);
             this.btnRemoveTarget.Name = "btnRemoveTarget";
@@ -120,6 +122,9 @@ namespace ISCSIConsole
             // 
             // listTargets
             // 
+            this.listTargets.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
             this.listTargets.FormattingEnabled = true;
             this.listTargets.ItemHeight = 12;
             this.listTargets.Location = new System.Drawing.Point(79, 57);
@@ -135,7 +140,6 @@ namespace ISCSIConsole
             this.statusStrip1.Location = new System.Drawing.Point(0, 159);
             this.statusStrip1.Name = "statusStrip1";
             this.statusStrip1.Size = new System.Drawing.Size(464, 22);
-            this.statusStrip1.SizingGrip = false;
             this.statusStrip1.TabIndex = 10;
             this.statusStrip1.Text = "statusStrip1";
             // 
@@ -146,6 +150,7 @@ namespace ISCSIConsole
             // 
             // LoadConfigButton
             // 
+            this.LoadConfigButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.LoadConfigButton.Location = new System.Drawing.Point(354, 122);
             this.LoadConfigButton.Name = "LoadConfigButton";
             this.LoadConfigButton.Size = new System.Drawing.Size(106, 23);
@@ -170,9 +175,6 @@ namespace ISCSIConsole
             this.Controls.Add(this.txtPort);
             this.Controls.Add(this.lblPort);
             this.Controls.Add(this.btnStart);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
-            this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(480, 220);
             this.MinimumSize = new System.Drawing.Size(480, 220);
             this.Name = "MainForm";
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;