From 499898fdf539fa65e089392015ddfba25d54484a Mon Sep 17 00:00:00 2001 From: henning724 <9609256+henning724@users.noreply.github.com> Date: Fri, 20 Mar 2020 20:24:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E9=83=A8=E5=88=86=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E6=94=BE=E5=88=B0table=E4=B8=AD=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=85=8D=E7=BD=AE=E6=95=B0=E4=B8=BA0=E6=97=B6?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=B3=BB=E7=BB=9F=E4=B8=8A=E7=9A=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Netch/Forms/MainForm.Designer.cs | 414 ++++++++++++++++++------------- Netch/Forms/MainForm.cs | 5 +- 2 files changed, 242 insertions(+), 177 deletions(-) diff --git a/Netch/Forms/MainForm.Designer.cs b/Netch/Forms/MainForm.Designer.cs index fcf1509f..e5b21fdf 100644 --- a/Netch/Forms/MainForm.Designer.cs +++ b/Netch/Forms/MainForm.Designer.cs @@ -53,23 +53,27 @@ namespace Netch.Forms this.AboutToolStripButton = new System.Windows.Forms.ToolStripButton(); this.VersionLabel = new System.Windows.Forms.ToolStripLabel(); this.ConfigurationGroupBox = new System.Windows.Forms.GroupBox(); - this.CopyLinkPictureBox = new System.Windows.Forms.PictureBox(); - this.DeleteModePictureBox = new System.Windows.Forms.PictureBox(); - this.EditModePictureBox = new System.Windows.Forms.PictureBox(); - this.ProfileNameText = new System.Windows.Forms.TextBox(); + this.configLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.ProfileLabel = new System.Windows.Forms.Label(); - this.SpeedPictureBox = new System.Windows.Forms.PictureBox(); - this.DeletePictureBox = new System.Windows.Forms.PictureBox(); - this.EditPictureBox = new System.Windows.Forms.PictureBox(); this.ModeLabel = new System.Windows.Forms.Label(); + this.ServerLabel = new System.Windows.Forms.Label(); + this.ProfileNameText = new System.Windows.Forms.TextBox(); this.ModeComboBox = new System.Windows.Forms.SearchComboBox(); this.ServerComboBox = new System.Windows.Forms.ComboBox(); - this.ServerLabel = new System.Windows.Forms.Label(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.EditPictureBox = new System.Windows.Forms.PictureBox(); + this.CopyLinkPictureBox = new System.Windows.Forms.PictureBox(); + this.DeletePictureBox = new System.Windows.Forms.PictureBox(); + this.SpeedPictureBox = new System.Windows.Forms.PictureBox(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.EditModePictureBox = new System.Windows.Forms.PictureBox(); + this.DeleteModePictureBox = new System.Windows.Forms.PictureBox(); this.StatusStrip = new System.Windows.Forms.StatusStrip(); this.StatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.UsedBandwidthLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.DownloadSpeedLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.UploadSpeedLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.NatTypeStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.ControlButton = new System.Windows.Forms.Button(); this.NotifyIcon = new System.Windows.Forms.NotifyIcon(this.components); this.NotifyMenu = new System.Windows.Forms.ContextMenuStrip(this.components); @@ -78,15 +82,17 @@ namespace Netch.Forms this.SettingsButton = new System.Windows.Forms.Button(); this.ProfileGroupBox = new System.Windows.Forms.GroupBox(); this.ProfileTable = new System.Windows.Forms.TableLayoutPanel(); - this.NatTypeStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.MenuStrip.SuspendLayout(); this.ConfigurationGroupBox.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.CopyLinkPictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.DeleteModePictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.EditModePictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.SpeedPictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.DeletePictureBox)).BeginInit(); + this.configLayoutPanel.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.EditPictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.CopyLinkPictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.DeletePictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.SpeedPictureBox)).BeginInit(); + this.tableLayoutPanel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.EditModePictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.DeleteModePictureBox)).BeginInit(); this.StatusStrip.SuspendLayout(); this.NotifyMenu.SuspendLayout(); this.ProfileGroupBox.SuspendLayout(); @@ -106,7 +112,7 @@ namespace Netch.Forms this.MenuStrip.Location = new System.Drawing.Point(0, 0); this.MenuStrip.Name = "MenuStrip"; this.MenuStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; - this.MenuStrip.Size = new System.Drawing.Size(629, 26); + this.MenuStrip.Size = new System.Drawing.Size(629, 24); this.MenuStrip.TabIndex = 0; // // ServerToolStripMenuItem @@ -119,41 +125,41 @@ namespace Netch.Forms this.AddVMessServerToolStripMenuItem}); this.ServerToolStripMenuItem.Margin = new System.Windows.Forms.Padding(3, 0, 0, 1); this.ServerToolStripMenuItem.Name = "ServerToolStripMenuItem"; - this.ServerToolStripMenuItem.Size = new System.Drawing.Size(57, 21); + this.ServerToolStripMenuItem.Size = new System.Drawing.Size(51, 19); this.ServerToolStripMenuItem.Text = "Server"; // // ImportServersFromClipboardToolStripMenuItem // this.ImportServersFromClipboardToolStripMenuItem.Name = "ImportServersFromClipboardToolStripMenuItem"; - this.ImportServersFromClipboardToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.ImportServersFromClipboardToolStripMenuItem.Size = new System.Drawing.Size(236, 22); this.ImportServersFromClipboardToolStripMenuItem.Text = "Import Servers From Clipboard"; this.ImportServersFromClipboardToolStripMenuItem.Click += new System.EventHandler(this.ImportServersFromClipboardToolStripMenuItem_Click); // // AddSocks5ServerToolStripMenuItem // this.AddSocks5ServerToolStripMenuItem.Name = "AddSocks5ServerToolStripMenuItem"; - this.AddSocks5ServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.AddSocks5ServerToolStripMenuItem.Size = new System.Drawing.Size(236, 22); this.AddSocks5ServerToolStripMenuItem.Text = "Add [Socks5] Server"; this.AddSocks5ServerToolStripMenuItem.Click += new System.EventHandler(this.AddSocks5ServerToolStripMenuItem_Click); // // AddShadowsocksServerToolStripMenuItem // this.AddShadowsocksServerToolStripMenuItem.Name = "AddShadowsocksServerToolStripMenuItem"; - this.AddShadowsocksServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.AddShadowsocksServerToolStripMenuItem.Size = new System.Drawing.Size(236, 22); this.AddShadowsocksServerToolStripMenuItem.Text = "Add [Shadowsocks] Server"; this.AddShadowsocksServerToolStripMenuItem.Click += new System.EventHandler(this.AddShadowsocksServerToolStripMenuItem_Click); // // AddShadowsocksRServerToolStripMenuItem // this.AddShadowsocksRServerToolStripMenuItem.Name = "AddShadowsocksRServerToolStripMenuItem"; - this.AddShadowsocksRServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.AddShadowsocksRServerToolStripMenuItem.Size = new System.Drawing.Size(236, 22); this.AddShadowsocksRServerToolStripMenuItem.Text = "Add [ShadowsocksR] Server"; this.AddShadowsocksRServerToolStripMenuItem.Click += new System.EventHandler(this.AddShadowsocksRServerToolStripMenuItem_Click); // // AddVMessServerToolStripMenuItem // this.AddVMessServerToolStripMenuItem.Name = "AddVMessServerToolStripMenuItem"; - this.AddVMessServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.AddVMessServerToolStripMenuItem.Size = new System.Drawing.Size(236, 22); this.AddVMessServerToolStripMenuItem.Text = "Add [VMess] Server"; this.AddVMessServerToolStripMenuItem.Click += new System.EventHandler(this.AddVMessServerToolStripMenuItem_Click); // @@ -164,20 +170,20 @@ namespace Netch.Forms this.ManageProcessModeToolStripMenuItem}); this.ModeToolStripMenuItem.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); this.ModeToolStripMenuItem.Name = "ModeToolStripMenuItem"; - this.ModeToolStripMenuItem.Size = new System.Drawing.Size(55, 21); + this.ModeToolStripMenuItem.Size = new System.Drawing.Size(50, 19); this.ModeToolStripMenuItem.Text = "Mode"; // // CreateProcessModeToolStripMenuItem // this.CreateProcessModeToolStripMenuItem.Name = "CreateProcessModeToolStripMenuItem"; - this.CreateProcessModeToolStripMenuItem.Size = new System.Drawing.Size(212, 22); + this.CreateProcessModeToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.CreateProcessModeToolStripMenuItem.Text = "Create Process Mode"; this.CreateProcessModeToolStripMenuItem.Click += new System.EventHandler(this.CreateProcessModeToolStripButton_Click); // // ManageProcessModeToolStripMenuItem // this.ManageProcessModeToolStripMenuItem.Name = "ManageProcessModeToolStripMenuItem"; - this.ManageProcessModeToolStripMenuItem.Size = new System.Drawing.Size(212, 22); + this.ManageProcessModeToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.ManageProcessModeToolStripMenuItem.Text = "Manage Process Mode"; this.ManageProcessModeToolStripMenuItem.Click += new System.EventHandler(this.ManageProcessModeToolStripMenuItem_Click); // @@ -188,20 +194,20 @@ namespace Netch.Forms this.UpdateServersFromSubscribeLinksToolStripMenuItem}); this.SubscribeToolStripMenuItem.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); this.SubscribeToolStripMenuItem.Name = "SubscribeToolStripMenuItem"; - this.SubscribeToolStripMenuItem.Size = new System.Drawing.Size(77, 21); + this.SubscribeToolStripMenuItem.Size = new System.Drawing.Size(70, 19); this.SubscribeToolStripMenuItem.Text = "Subscribe"; // // ManageSubscribeLinksToolStripMenuItem // this.ManageSubscribeLinksToolStripMenuItem.Name = "ManageSubscribeLinksToolStripMenuItem"; - this.ManageSubscribeLinksToolStripMenuItem.Size = new System.Drawing.Size(294, 22); + this.ManageSubscribeLinksToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.ManageSubscribeLinksToolStripMenuItem.Text = "Manage Subscribe Links"; this.ManageSubscribeLinksToolStripMenuItem.Click += new System.EventHandler(this.ManageSubscribeLinksToolStripMenuItem_Click); // // UpdateServersFromSubscribeLinksToolStripMenuItem // this.UpdateServersFromSubscribeLinksToolStripMenuItem.Name = "UpdateServersFromSubscribeLinksToolStripMenuItem"; - this.UpdateServersFromSubscribeLinksToolStripMenuItem.Size = new System.Drawing.Size(294, 22); + this.UpdateServersFromSubscribeLinksToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.UpdateServersFromSubscribeLinksToolStripMenuItem.Text = "Update Servers From Subscribe Links"; this.UpdateServersFromSubscribeLinksToolStripMenuItem.Click += new System.EventHandler(this.UpdateServersFromSubscribeLinksToolStripMenuItem_Click); // @@ -214,34 +220,34 @@ namespace Netch.Forms this.CleanDNSCacheToolStripMenuItem}); this.OptionsToolStripMenuItem.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); this.OptionsToolStripMenuItem.Name = "OptionsToolStripMenuItem"; - this.OptionsToolStripMenuItem.Size = new System.Drawing.Size(66, 21); + this.OptionsToolStripMenuItem.Size = new System.Drawing.Size(61, 19); this.OptionsToolStripMenuItem.Text = "Options"; // // ReloadModesToolStripMenuItem // this.ReloadModesToolStripMenuItem.Name = "ReloadModesToolStripMenuItem"; - this.ReloadModesToolStripMenuItem.Size = new System.Drawing.Size(177, 22); + this.ReloadModesToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.ReloadModesToolStripMenuItem.Text = "Reload Modes"; this.ReloadModesToolStripMenuItem.Click += new System.EventHandler(this.ReloadModesToolStripMenuItem_Click); // // RestartServiceToolStripMenuItem // this.RestartServiceToolStripMenuItem.Name = "RestartServiceToolStripMenuItem"; - this.RestartServiceToolStripMenuItem.Size = new System.Drawing.Size(177, 22); + this.RestartServiceToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.RestartServiceToolStripMenuItem.Text = "Restart Service"; this.RestartServiceToolStripMenuItem.Click += new System.EventHandler(this.RestartServiceToolStripMenuItem_Click); // // UninstallServiceToolStripMenuItem // this.UninstallServiceToolStripMenuItem.Name = "UninstallServiceToolStripMenuItem"; - this.UninstallServiceToolStripMenuItem.Size = new System.Drawing.Size(177, 22); + this.UninstallServiceToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.UninstallServiceToolStripMenuItem.Text = "Uninstall Service"; this.UninstallServiceToolStripMenuItem.Click += new System.EventHandler(this.UninstallServiceToolStripMenuItem_Click); // // CleanDNSCacheToolStripMenuItem // this.CleanDNSCacheToolStripMenuItem.Name = "CleanDNSCacheToolStripMenuItem"; - this.CleanDNSCacheToolStripMenuItem.Size = new System.Drawing.Size(177, 22); + this.CleanDNSCacheToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.CleanDNSCacheToolStripMenuItem.Text = "Clean DNS Cache"; this.CleanDNSCacheToolStripMenuItem.Click += new System.EventHandler(this.CleanDNSCacheToolStripMenuItem_Click); // @@ -251,7 +257,7 @@ namespace Netch.Forms this.AboutToolStripButton.AutoToolTip = false; this.AboutToolStripButton.Margin = new System.Windows.Forms.Padding(0, 0, 3, 1); this.AboutToolStripButton.Name = "AboutToolStripButton"; - this.AboutToolStripButton.Size = new System.Drawing.Size(47, 21); + this.AboutToolStripButton.Size = new System.Drawing.Size(44, 19); this.AboutToolStripButton.Text = "About"; this.AboutToolStripButton.Click += new System.EventHandler(this.AboutToolStripButton_Click); // @@ -263,52 +269,186 @@ namespace Netch.Forms this.VersionLabel.IsLink = true; this.VersionLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline; this.VersionLabel.Name = "VersionLabel"; - this.VersionLabel.Size = new System.Drawing.Size(32, 19); + this.VersionLabel.Size = new System.Drawing.Size(31, 17); this.VersionLabel.Text = "x.x.x"; this.VersionLabel.Click += new System.EventHandler(this.VersionLabel_Click); // // ConfigurationGroupBox // - this.ConfigurationGroupBox.Controls.Add(this.CopyLinkPictureBox); - this.ConfigurationGroupBox.Controls.Add(this.DeleteModePictureBox); - this.ConfigurationGroupBox.Controls.Add(this.EditModePictureBox); - this.ConfigurationGroupBox.Controls.Add(this.ProfileNameText); - this.ConfigurationGroupBox.Controls.Add(this.ProfileLabel); - this.ConfigurationGroupBox.Controls.Add(this.SpeedPictureBox); - this.ConfigurationGroupBox.Controls.Add(this.DeletePictureBox); - this.ConfigurationGroupBox.Controls.Add(this.EditPictureBox); - this.ConfigurationGroupBox.Controls.Add(this.ModeLabel); - this.ConfigurationGroupBox.Controls.Add(this.ModeComboBox); - this.ConfigurationGroupBox.Controls.Add(this.ServerComboBox); - this.ConfigurationGroupBox.Controls.Add(this.ServerLabel); + this.ConfigurationGroupBox.Controls.Add(this.configLayoutPanel); this.ConfigurationGroupBox.Location = new System.Drawing.Point(12, 28); this.ConfigurationGroupBox.Name = "ConfigurationGroupBox"; - this.ConfigurationGroupBox.Size = new System.Drawing.Size(605, 113); + this.ConfigurationGroupBox.Size = new System.Drawing.Size(605, 115); this.ConfigurationGroupBox.TabIndex = 1; this.ConfigurationGroupBox.TabStop = false; this.ConfigurationGroupBox.Text = "Configuration"; // + // configLayoutPanel + // + this.configLayoutPanel.ColumnCount = 3; + this.configLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.configLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.configLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.configLayoutPanel.Controls.Add(this.ProfileLabel, 0, 2); + this.configLayoutPanel.Controls.Add(this.ModeLabel, 0, 1); + this.configLayoutPanel.Controls.Add(this.ServerLabel, 0, 0); + this.configLayoutPanel.Controls.Add(this.ProfileNameText, 1, 2); + this.configLayoutPanel.Controls.Add(this.ModeComboBox, 1, 1); + this.configLayoutPanel.Controls.Add(this.ServerComboBox, 1, 0); + this.configLayoutPanel.Controls.Add(this.tableLayoutPanel2, 2, 0); + this.configLayoutPanel.Controls.Add(this.tableLayoutPanel3, 2, 1); + this.configLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.configLayoutPanel.Location = new System.Drawing.Point(3, 19); + this.configLayoutPanel.Name = "configLayoutPanel"; + this.configLayoutPanel.RowCount = 3; + this.configLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.configLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.configLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.configLayoutPanel.Size = new System.Drawing.Size(599, 93); + this.configLayoutPanel.TabIndex = 15; + // + // ProfileLabel + // + this.ProfileLabel.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.ProfileLabel.AutoSize = true; + this.ProfileLabel.Location = new System.Drawing.Point(3, 69); + this.ProfileLabel.Name = "ProfileLabel"; + this.ProfileLabel.Size = new System.Drawing.Size(45, 17); + this.ProfileLabel.TabIndex = 10; + this.ProfileLabel.Text = "Profile"; + // + // ModeLabel + // + this.ModeLabel.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.ModeLabel.AutoSize = true; + this.ModeLabel.Location = new System.Drawing.Point(3, 38); + this.ModeLabel.Name = "ModeLabel"; + this.ModeLabel.Size = new System.Drawing.Size(43, 17); + this.ModeLabel.TabIndex = 3; + this.ModeLabel.Text = "Mode"; + // + // ServerLabel + // + this.ServerLabel.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.ServerLabel.AutoSize = true; + this.ServerLabel.Location = new System.Drawing.Point(3, 7); + this.ServerLabel.Name = "ServerLabel"; + this.ServerLabel.Size = new System.Drawing.Size(45, 17); + this.ServerLabel.TabIndex = 0; + this.ServerLabel.Text = "Server"; + // + // ProfileNameText + // + this.ProfileNameText.Dock = System.Windows.Forms.DockStyle.Fill; + this.ProfileNameText.Location = new System.Drawing.Point(54, 65); + this.ProfileNameText.Name = "ProfileNameText"; + this.ProfileNameText.Size = new System.Drawing.Size(442, 23); + this.ProfileNameText.TabIndex = 11; + // + // ModeComboBox + // + this.ModeComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.ModeComboBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.ModeComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.ModeComboBox.FormattingEnabled = true; + this.ModeComboBox.IntegralHeight = false; + this.ModeComboBox.Location = new System.Drawing.Point(54, 34); + this.ModeComboBox.Name = "ModeComboBox"; + this.ModeComboBox.Size = new System.Drawing.Size(442, 24); + this.ModeComboBox.TabIndex = 2; + this.ModeComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); + // + // ServerComboBox + // + this.ServerComboBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.ServerComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.ServerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.ServerComboBox.FormattingEnabled = true; + this.ServerComboBox.IntegralHeight = false; + this.ServerComboBox.Location = new System.Drawing.Point(54, 3); + this.ServerComboBox.MaxDropDownItems = 16; + this.ServerComboBox.Name = "ServerComboBox"; + this.ServerComboBox.Size = new System.Drawing.Size(442, 24); + this.ServerComboBox.TabIndex = 1; + this.ServerComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 4; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel2.Controls.Add(this.EditPictureBox, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.CopyLinkPictureBox, 3, 0); + this.tableLayoutPanel2.Controls.Add(this.DeletePictureBox, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.SpeedPictureBox, 2, 0); + this.tableLayoutPanel2.Location = new System.Drawing.Point(502, 3); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 1; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(94, 24); + this.tableLayoutPanel2.TabIndex = 12; + // + // EditPictureBox + // + this.EditPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; + this.EditPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("EditPictureBox.Image"))); + this.EditPictureBox.Location = new System.Drawing.Point(3, 3); + this.EditPictureBox.Name = "EditPictureBox"; + this.EditPictureBox.Size = new System.Drawing.Size(16, 16); + this.EditPictureBox.TabIndex = 7; + this.EditPictureBox.TabStop = false; + this.EditPictureBox.Click += new System.EventHandler(this.EditPictureBox_Click); + // // CopyLinkPictureBox // this.CopyLinkPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; this.CopyLinkPictureBox.Image = global::Netch.Properties.Resources.CopyLink; - this.CopyLinkPictureBox.Location = new System.Drawing.Point(582, 25); + this.CopyLinkPictureBox.Location = new System.Drawing.Point(72, 3); this.CopyLinkPictureBox.Name = "CopyLinkPictureBox"; this.CopyLinkPictureBox.Size = new System.Drawing.Size(18, 18); this.CopyLinkPictureBox.TabIndex = 14; this.CopyLinkPictureBox.TabStop = false; this.CopyLinkPictureBox.Click += new System.EventHandler(this.CopyLinkPictureBox_Click); // - // DeleteModePictureBox + // DeletePictureBox // - this.DeleteModePictureBox.Cursor = System.Windows.Forms.Cursors.Hand; - this.DeleteModePictureBox.Image = global::Netch.Properties.Resources.delete; - this.DeleteModePictureBox.Location = new System.Drawing.Point(540, 57); - this.DeleteModePictureBox.Name = "DeleteModePictureBox"; - this.DeleteModePictureBox.Size = new System.Drawing.Size(16, 16); - this.DeleteModePictureBox.TabIndex = 13; - this.DeleteModePictureBox.TabStop = false; - this.DeleteModePictureBox.Click += new System.EventHandler(this.DeleteModePictureBox_Click); + this.DeletePictureBox.Cursor = System.Windows.Forms.Cursors.Hand; + this.DeletePictureBox.Image = ((System.Drawing.Image)(resources.GetObject("DeletePictureBox.Image"))); + this.DeletePictureBox.Location = new System.Drawing.Point(26, 3); + this.DeletePictureBox.Name = "DeletePictureBox"; + this.DeletePictureBox.Size = new System.Drawing.Size(16, 16); + this.DeletePictureBox.TabIndex = 8; + this.DeletePictureBox.TabStop = false; + this.DeletePictureBox.Click += new System.EventHandler(this.DeletePictureBox_Click); + // + // SpeedPictureBox + // + this.SpeedPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; + this.SpeedPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("SpeedPictureBox.Image"))); + this.SpeedPictureBox.Location = new System.Drawing.Point(49, 3); + this.SpeedPictureBox.Name = "SpeedPictureBox"; + this.SpeedPictureBox.Size = new System.Drawing.Size(16, 16); + this.SpeedPictureBox.TabIndex = 9; + this.SpeedPictureBox.TabStop = false; + this.SpeedPictureBox.Click += new System.EventHandler(this.SpeedPictureBox_Click); + // + // tableLayoutPanel3 + // + this.tableLayoutPanel3.ColumnCount = 4; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel3.Controls.Add(this.EditModePictureBox, 0, 0); + this.tableLayoutPanel3.Controls.Add(this.DeleteModePictureBox, 1, 0); + this.tableLayoutPanel3.Location = new System.Drawing.Point(502, 34); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 1; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(94, 24); + this.tableLayoutPanel3.TabIndex = 13; // // EditModePictureBox // @@ -316,104 +456,23 @@ namespace Netch.Forms this.EditModePictureBox.ErrorImage = global::Netch.Properties.Resources.edit; this.EditModePictureBox.Image = global::Netch.Properties.Resources.edit; this.EditModePictureBox.InitialImage = global::Netch.Properties.Resources.edit; - this.EditModePictureBox.Location = new System.Drawing.Point(518, 56); + this.EditModePictureBox.Location = new System.Drawing.Point(3, 3); this.EditModePictureBox.Name = "EditModePictureBox"; this.EditModePictureBox.Size = new System.Drawing.Size(16, 16); this.EditModePictureBox.TabIndex = 12; this.EditModePictureBox.TabStop = false; this.EditModePictureBox.Click += new System.EventHandler(this.EditModePictureBox_Click); // - // ProfileNameText + // DeleteModePictureBox // - this.ProfileNameText.Location = new System.Drawing.Point(57, 83); - this.ProfileNameText.Name = "ProfileNameText"; - this.ProfileNameText.Size = new System.Drawing.Size(455, 23); - this.ProfileNameText.TabIndex = 11; - // - // ProfileLabel - // - this.ProfileLabel.AutoSize = true; - this.ProfileLabel.Location = new System.Drawing.Point(6, 86); - this.ProfileLabel.Name = "ProfileLabel"; - this.ProfileLabel.Size = new System.Drawing.Size(45, 17); - this.ProfileLabel.TabIndex = 10; - this.ProfileLabel.Text = "Profile"; - // - // SpeedPictureBox - // - this.SpeedPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; - this.SpeedPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("SpeedPictureBox.Image"))); - this.SpeedPictureBox.Location = new System.Drawing.Point(562, 26); - this.SpeedPictureBox.Name = "SpeedPictureBox"; - this.SpeedPictureBox.Size = new System.Drawing.Size(16, 16); - this.SpeedPictureBox.TabIndex = 9; - this.SpeedPictureBox.TabStop = false; - this.SpeedPictureBox.Click += new System.EventHandler(this.SpeedPictureBox_Click); - // - // DeletePictureBox - // - this.DeletePictureBox.Cursor = System.Windows.Forms.Cursors.Hand; - this.DeletePictureBox.Image = ((System.Drawing.Image)(resources.GetObject("DeletePictureBox.Image"))); - this.DeletePictureBox.Location = new System.Drawing.Point(540, 26); - this.DeletePictureBox.Name = "DeletePictureBox"; - this.DeletePictureBox.Size = new System.Drawing.Size(16, 16); - this.DeletePictureBox.TabIndex = 8; - this.DeletePictureBox.TabStop = false; - this.DeletePictureBox.Click += new System.EventHandler(this.DeletePictureBox_Click); - // - // EditPictureBox - // - this.EditPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; - this.EditPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("EditPictureBox.Image"))); - this.EditPictureBox.Location = new System.Drawing.Point(518, 26); - this.EditPictureBox.Name = "EditPictureBox"; - this.EditPictureBox.Size = new System.Drawing.Size(16, 16); - this.EditPictureBox.TabIndex = 7; - this.EditPictureBox.TabStop = false; - this.EditPictureBox.Click += new System.EventHandler(this.EditPictureBox_Click); - // - // ModeLabel - // - this.ModeLabel.AutoSize = true; - this.ModeLabel.Location = new System.Drawing.Point(6, 56); - this.ModeLabel.Name = "ModeLabel"; - this.ModeLabel.Size = new System.Drawing.Size(43, 17); - this.ModeLabel.TabIndex = 3; - this.ModeLabel.Text = "Mode"; - // - // ModeComboBox - // - this.ModeComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; - this.ModeComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ModeComboBox.FormattingEnabled = true; - this.ModeComboBox.IntegralHeight = false; - this.ModeComboBox.Location = new System.Drawing.Point(57, 53); - this.ModeComboBox.Name = "ModeComboBox"; - this.ModeComboBox.Size = new System.Drawing.Size(455, 24); - this.ModeComboBox.TabIndex = 2; - this.ModeComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); - // - // ServerComboBox - // - this.ServerComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ServerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ServerComboBox.FormattingEnabled = true; - this.ServerComboBox.IntegralHeight = false; - this.ServerComboBox.Location = new System.Drawing.Point(57, 22); - this.ServerComboBox.MaxDropDownItems = 16; - this.ServerComboBox.Name = "ServerComboBox"; - this.ServerComboBox.Size = new System.Drawing.Size(455, 24); - this.ServerComboBox.TabIndex = 1; - this.ServerComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); - // - // ServerLabel - // - this.ServerLabel.AutoSize = true; - this.ServerLabel.Location = new System.Drawing.Point(6, 26); - this.ServerLabel.Name = "ServerLabel"; - this.ServerLabel.Size = new System.Drawing.Size(45, 17); - this.ServerLabel.TabIndex = 0; - this.ServerLabel.Text = "Server"; + this.DeleteModePictureBox.Cursor = System.Windows.Forms.Cursors.Hand; + this.DeleteModePictureBox.Image = global::Netch.Properties.Resources.delete; + this.DeleteModePictureBox.Location = new System.Drawing.Point(26, 3); + this.DeleteModePictureBox.Name = "DeleteModePictureBox"; + this.DeleteModePictureBox.Size = new System.Drawing.Size(16, 16); + this.DeleteModePictureBox.TabIndex = 13; + this.DeleteModePictureBox.TabStop = false; + this.DeleteModePictureBox.Click += new System.EventHandler(this.DeleteModePictureBox_Click); // // StatusStrip // @@ -424,7 +483,7 @@ namespace Netch.Forms this.DownloadSpeedLabel, this.UploadSpeedLabel, this.NatTypeStatusLabel}); - this.StatusStrip.Location = new System.Drawing.Point(0, 254); + this.StatusStrip.Location = new System.Drawing.Point(0, 250); this.StatusStrip.Name = "StatusStrip"; this.StatusStrip.Size = new System.Drawing.Size(629, 22); this.StatusStrip.SizingGrip = false; @@ -434,40 +493,45 @@ namespace Netch.Forms // this.StatusLabel.BackColor = System.Drawing.Color.Transparent; this.StatusLabel.Name = "StatusLabel"; - this.StatusLabel.Size = new System.Drawing.Size(177, 17); + this.StatusLabel.Size = new System.Drawing.Size(162, 17); this.StatusLabel.Text = "Status: Waiting for command"; // // UsedBandwidthLabel // this.UsedBandwidthLabel.Name = "UsedBandwidthLabel"; - this.UsedBandwidthLabel.Size = new System.Drawing.Size(72, 17); + this.UsedBandwidthLabel.Size = new System.Drawing.Size(62, 17); this.UsedBandwidthLabel.Text = "Used: 0 KB"; this.UsedBandwidthLabel.Visible = false; // // DownloadSpeedLabel // this.DownloadSpeedLabel.Name = "DownloadSpeedLabel"; - this.DownloadSpeedLabel.Size = new System.Drawing.Size(59, 17); + this.DownloadSpeedLabel.Size = new System.Drawing.Size(52, 17); this.DownloadSpeedLabel.Text = "↓: 0 KB/s"; this.DownloadSpeedLabel.Visible = false; // // UploadSpeedLabel // this.UploadSpeedLabel.Name = "UploadSpeedLabel"; - this.UploadSpeedLabel.Size = new System.Drawing.Size(59, 17); + this.UploadSpeedLabel.Size = new System.Drawing.Size(52, 17); this.UploadSpeedLabel.Text = "↑: 0 KB/s"; this.UploadSpeedLabel.Visible = false; // + // NatTypeStatusLabel + // + this.NatTypeStatusLabel.Name = "NatTypeStatusLabel"; + this.NatTypeStatusLabel.Size = new System.Drawing.Size(0, 17); + // // ControlButton // - this.ControlButton.Location = new System.Drawing.Point(542, 219); + this.ControlButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.ControlButton.Location = new System.Drawing.Point(542, 215); this.ControlButton.Name = "ControlButton"; this.ControlButton.Size = new System.Drawing.Size(75, 27); this.ControlButton.TabIndex = 3; this.ControlButton.Text = "Start"; this.ControlButton.UseVisualStyleBackColor = true; this.ControlButton.Click += new System.EventHandler(this.ControlButton_Click); - this.ControlButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); // // NotifyIcon // @@ -485,37 +549,37 @@ namespace Netch.Forms this.ExitToolStripButton}); this.NotifyMenu.Name = "NotifyMenu"; this.NotifyMenu.ShowItemToolTips = false; - this.NotifyMenu.Size = new System.Drawing.Size(108, 48); + this.NotifyMenu.Size = new System.Drawing.Size(104, 48); // // ShowMainFormToolStripButton // this.ShowMainFormToolStripButton.Name = "ShowMainFormToolStripButton"; - this.ShowMainFormToolStripButton.Size = new System.Drawing.Size(107, 22); + this.ShowMainFormToolStripButton.Size = new System.Drawing.Size(103, 22); this.ShowMainFormToolStripButton.Text = "Show"; this.ShowMainFormToolStripButton.Click += new System.EventHandler(this.ShowMainFormToolStripButton_Click); // // ExitToolStripButton // this.ExitToolStripButton.Name = "ExitToolStripButton"; - this.ExitToolStripButton.Size = new System.Drawing.Size(107, 22); + this.ExitToolStripButton.Size = new System.Drawing.Size(103, 22); this.ExitToolStripButton.Text = "Exit"; this.ExitToolStripButton.Click += new System.EventHandler(this.ExitToolStripButton_Click); // // SettingsButton // - this.SettingsButton.Location = new System.Drawing.Point(12, 219); + this.SettingsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.SettingsButton.Location = new System.Drawing.Point(12, 215); this.SettingsButton.Name = "SettingsButton"; this.SettingsButton.Size = new System.Drawing.Size(72, 27); this.SettingsButton.TabIndex = 4; this.SettingsButton.Text = "Settings"; this.SettingsButton.UseVisualStyleBackColor = true; this.SettingsButton.Click += new System.EventHandler(this.SettingsButton_Click); - this.SettingsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); // // ProfileGroupBox // this.ProfileGroupBox.Controls.Add(this.ProfileTable); - this.ProfileGroupBox.Location = new System.Drawing.Point(12, 147); + this.ProfileGroupBox.Location = new System.Drawing.Point(12, 146); this.ProfileGroupBox.Name = "ProfileGroupBox"; this.ProfileGroupBox.Size = new System.Drawing.Size(605, 65); this.ProfileGroupBox.TabIndex = 13; @@ -538,24 +602,18 @@ namespace Netch.Forms this.ProfileTable.Size = new System.Drawing.Size(599, 43); this.ProfileTable.TabIndex = 0; // - // NatTypeStatusLabel - // - this.NatTypeStatusLabel.Name = "NatTypeStatusLabel"; - this.NatTypeStatusLabel.Size = new System.Drawing.Size(109, 17); - this.NatTypeStatusLabel.Text = ""; - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(629, 276); + this.ClientSize = new System.Drawing.Size(629, 272); this.Controls.Add(this.ProfileGroupBox); this.Controls.Add(this.SettingsButton); this.Controls.Add(this.ControlButton); this.Controls.Add(this.StatusStrip); this.Controls.Add(this.ConfigurationGroupBox); this.Controls.Add(this.MenuStrip); - this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Font = new System.Drawing.Font("Microsoft YaHei", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); @@ -568,13 +626,16 @@ namespace Netch.Forms this.MenuStrip.ResumeLayout(false); this.MenuStrip.PerformLayout(); this.ConfigurationGroupBox.ResumeLayout(false); - this.ConfigurationGroupBox.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.CopyLinkPictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.DeleteModePictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.EditModePictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.SpeedPictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.DeletePictureBox)).EndInit(); + this.configLayoutPanel.ResumeLayout(false); + this.configLayoutPanel.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.EditPictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.CopyLinkPictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.DeletePictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.SpeedPictureBox)).EndInit(); + this.tableLayoutPanel3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.EditModePictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.DeleteModePictureBox)).EndInit(); this.StatusStrip.ResumeLayout(false); this.StatusStrip.PerformLayout(); this.NotifyMenu.ResumeLayout(false); @@ -634,5 +695,8 @@ namespace Netch.Forms private System.Windows.Forms.PictureBox DeleteModePictureBox; private System.Windows.Forms.PictureBox CopyLinkPictureBox; private System.Windows.Forms.ToolStripStatusLabel NatTypeStatusLabel; + private System.Windows.Forms.TableLayoutPanel configLayoutPanel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; } } \ No newline at end of file diff --git a/Netch/Forms/MainForm.cs b/Netch/Forms/MainForm.cs index 85d186ca..0f408b80 100644 --- a/Netch/Forms/MainForm.cs +++ b/Netch/Forms/MainForm.cs @@ -1102,8 +1102,9 @@ namespace Netch.Forms if (num_profile == 0) { ProfileGroupBox.Size = new Size(0,0); - ConfigurationGroupBox.Size -= new Size(0, 30); - this.Size -= new Size(0, 70 + 30); + ConfigurationGroupBox.Size -= new Size(0, 25); + this.Size -= new Size(0, 70 + 25); + configLayoutPanel.RowStyles[2].Height = 0; return; }