优化部分代码

This commit is contained in:
蓝点lilac
2021-03-13 00:40:48 +08:00
parent 9cd304ada6
commit 50978133ab
3 changed files with 8 additions and 8 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
<supportedRuntime version="v2.0.50727"/></startup>
<runtime>
<legacyCorruptedStateExceptionsPolicy enabled="true"/>
<EnableWindowsFormsHighDpiAutoResizing enabled="true"/>

View File

@@ -9,8 +9,11 @@ namespace BluePointLilac.Controls
public ReadOnlyTextBox()
{
this.ReadOnly = true;
this.Multiline = true;
this.ShortcutsEnabled = false;
this.BackColor = Color.White;
this.ForeColor = Color.FromArgb(80, 80, 80);
this.ScrollBars = ScrollBars.Vertical;
this.Font = new Font(SystemFonts.MenuFont.FontFamily, 10F);
}
@@ -41,6 +44,7 @@ namespace BluePointLilac.Controls
const int WM_SETFOCUS = 0x0007;
const int WM_KILLFOCUS = 0x0008;
protected override void WndProc(ref Message m)
{
switch(m.Msg)

View File

@@ -181,11 +181,7 @@ namespace ContextMenuManager.Controls
DropDownStyle = ComboBoxStyle.DropDownList
};
readonly ReadOnlyTextBox txtTranslators = new ReadOnlyTextBox
{
Multiline = true,
ScrollBars = ScrollBars.Vertical
};
readonly ReadOnlyTextBox txtTranslators = new ReadOnlyTextBox();
readonly PictureButton btnOpenDir = new PictureButton(AppImage.Open);
readonly PictureButton btnDownLoad = new PictureButton(AppImage.DownLoad);
readonly PictureButton btnTranslate = new PictureButton(AppImage.Translate);
@@ -197,7 +193,7 @@ namespace ContextMenuManager.Controls
int a = 20.DpiZoom();
txtTranslators.Width = this.ClientSize.Width - 2 * a;
txtTranslators.Height = this.ClientSize.Height - txtTranslators.Top - a;
cmbLanguages.Margin = txtTranslators.Margin = btnOpenDir.Margin
cmbLanguages.Margin = txtTranslators.Margin = btnOpenDir.Margin
= btnDownLoad.Margin = btnTranslate.Margin = new Padding(a, a, 0, 0);
}