mirror of
https://github.com/netchx/netch.git
synced 2026-05-11 23:45:06 +08:00
fix: ServerForm High DPI Scale #388
This commit is contained in:
5
Netch/Forms/ServerForm.Designer.cs
generated
5
Netch/Forms/ServerForm.Designer.cs
generated
@@ -124,11 +124,6 @@
|
||||
this.Name = "ServerForm";
|
||||
this.Padding = new System.Windows.Forms.Padding(11, 5, 11, 4);
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Load += new System.EventHandler(this.ServerForm_Load);
|
||||
this.ConfigurationGroupBox.ResumeLayout(false);
|
||||
this.ConfigurationGroupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -32,6 +32,35 @@ namespace Netch.Forms
|
||||
_saveActions.Add(PortTextBox, s => Server.Port = ushort.Parse((string) s));
|
||||
}
|
||||
|
||||
public new void ShowDialog()
|
||||
{
|
||||
AfterFactor();
|
||||
base.ShowDialog();
|
||||
}
|
||||
|
||||
public new void Show()
|
||||
{
|
||||
AfterFactor();
|
||||
base.Show();
|
||||
}
|
||||
|
||||
private void AfterFactor()
|
||||
{
|
||||
Text = TypeName ?? string.Empty;
|
||||
|
||||
RemarkTextBox.Text = Server.Remark;
|
||||
AddressTextBox.Text = Server.Hostname;
|
||||
PortTextBox.Text = Server.Port.ToString();
|
||||
|
||||
AddSaveButton();
|
||||
i18N.TranslateForm(this);
|
||||
|
||||
ConfigurationGroupBox.ResumeLayout(false);
|
||||
ConfigurationGroupBox.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
protected void CreateTextBox(string name, string remark, Func<string, bool> check, Action<string> save, string value, int width = InputBoxWidth)
|
||||
{
|
||||
_controlLines++;
|
||||
@@ -120,18 +149,6 @@ namespace Netch.Forms
|
||||
|
||||
private readonly Dictionary<Control, Action<object>> _saveActions = new Dictionary<Control, Action<object>>();
|
||||
|
||||
private void ServerForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Text = TypeName ?? string.Empty;
|
||||
|
||||
RemarkTextBox.Text = Server.Remark;
|
||||
AddressTextBox.Text = Server.Hostname;
|
||||
PortTextBox.Text = Server.Port.ToString();
|
||||
|
||||
AddSaveButton();
|
||||
i18N.TranslateForm(this);
|
||||
}
|
||||
|
||||
private void AddSaveButton()
|
||||
{
|
||||
_controlLines++;
|
||||
|
||||
Reference in New Issue
Block a user