配置数为0时,隐藏配置界面

This commit is contained in:
henning
2020-03-20 16:06:05 +08:00
parent 1912d2055f
commit ba50a23914
2 changed files with 10 additions and 0 deletions

View File

@@ -467,6 +467,7 @@ namespace Netch.Forms
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
//
@@ -509,6 +510,7 @@ namespace Netch.Forms
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
//

View File

@@ -1099,6 +1099,14 @@ namespace Netch.Forms
public void InitProfile()
{
var num_profile = Global.Settings.ProfileCount;
if (num_profile == 0)
{
ProfileGroupBox.Size = new Size(0,0);
ConfigurationGroupBox.Size -= new Size(0, 30);
this.Size -= new Size(0, 70 + 30);
return;
}
ProfileTable.ColumnCount = num_profile;
while (Global.Settings.profiles.Count < num_profile)