mirror of
https://github.com/BluePointLilac/ContextMenuManager.git
synced 2026-01-14 06:04:00 +08:00
优化部分代码
This commit is contained in:
@@ -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"/>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user