自定义窗口边框 c#_如何在Windows 10上自定义窗口边框和阴影

本文介绍了如何在Windows 10上自定义窗口边框颜色和禁用/启用窗口阴影。在设置中,你可以选择颜色或者禁用自动选择边框颜色的功能,以匹配桌面背景。此外,通过调整高级系统设置,可以关闭或开启窗口下的阴影效果。
摘要由CSDN通过智能技术生成
自定义窗口边框 c#

自定义窗口边框 c#

On Windows 10, each window has a colored window border and a shadow. You can change the color of your window borders and even disable the shadow, if you like.

在Windows 10上,每个窗口都有一个彩色的窗口边框和阴影。 您可以根据需要更改窗口边框的颜色,甚至禁用阴影。

Insider Preview builds of Redstone 5 change the default border color to gray so it blends in with the shadow, but you can re-enable colored window borders on Redstone 5, too.

Redstone 5的Insider Preview版本将默认边框颜色更改为灰色,以便与阴影融合,但是您也可以在Redstone 5上重新启用彩色的窗口边框。

如何选择边框颜色 (How to Choose a Border Color)

In the April 2018 Update and earlier versions of Windows 10, Windows automatically chooses a window color that matches your desktop background.

20184月更新和Windows 10的早期版本中,Windows会自动选择与您的桌面背景匹配的窗口颜色。

To choose a custom window border color, head to Settings > Personalization > Colors. Under the “Choose Your Color” section, disable the “Automatically pick an accent color from my background” option and choose your preferred color, instead.

要选择自定义窗口边框颜色,请转到“设置”>“个性化”>“颜色”。 在“选择颜色”部分下,禁用“从我的背景自动选择一种强调颜色”选项,然后选择您喜欢的颜色。

Windows provides a number of suggested colors here, but you can click the “Custom Color” option at the bottom of the list to choose any color you like.

Windows在此处提供了许多建议的颜色,但是您可以单击列表底部的“自定义颜色”选项以选择所需的任何颜色。

Windows 10’s Redstone 5 update, which will be released to the stable Windows build sometime in Fall, 2018, uses a gray window border by default. To apply your accent color to your window borders, scroll down to the “Show accent color on the following surfaces” section, and then enable the “Title bars and window borders” option.

Windows 10的Redstone 5更新将在2018年秋季的某个时候发布到稳定的Windows版本中,默认情况下使用灰色的窗口边框。 要将强调色应用于窗口边框,请向下滚动到“在以下表面上显示强调色”部分,然后启用“标题栏和窗口边框”选项。

You’ll see colored tabs in your title bars instead of fully colored title bars thanks to the Sets feature.

借助Sets功能,您将在标题栏中看到彩色的标签,而不是全彩色的标题栏

如何禁用(或启用)阴影 (How to Disable (or Enable) Shadows)

Windows 10 enables drop shadows for each window by default. However, you can turn these shadows off if you prefer. Windows 8 didn’t use shadows and had a clean, flat look with colored window borders, for example.

Windows 10默认情况下为每个窗口启用阴影。 但是,您可以根据需要关闭这些阴影。 例如,Windows 8不使用阴影,而是具有带彩色窗口边框的干净,平坦的外观。

This setting is available in the old Advanced System Settings window. To open it, hit Start, type “Advanced system settings” into the search box, and then press Enter. You can also head to Control Panel > System and Security > System > Advanced System Settings to launch it.

此设置在旧的“ 高级系统设置”窗口中可用。 要打开它,请单击开始,在搜索框中键入“高级系统设置”,然后按Enter。 您也可以转到控制面板>系统和安全性>系统>高级系统设置来启动它。

On the Advanced tab of the System Properties window, click the “Settings” button in the Performance section.

在“系统属性”窗口的“高级”选项卡上,单击“性能”部分中的“设置”按钮。

In the Visual Effects list, select the “Custom” option, disable the “Shadow shadows under windows” option, and then click the “OK” button.

在“视觉效果”列表中,选择“自定义”选项,禁用“ Windows下的阴影”选项,然后单击“确定”按钮。

Window shadows will instantly vanish. You can return here if you ever want to re-enable them.

窗口阴影将立即消失。 如果您想重新启用它们,可以返回此处。

翻译自: https://www.howtogeek.com/353204/how-to-customize-window-borders-and-shadows-on-windows-10/

自定义窗口边框 c#

代码介绍 MetroForWinForm(win8风格模版) using System; using System.Drawing; using System.Globalization; using System.Windows.Forms; using MetroFramework.Forms; namespace MetroFramework.Demo { public partial class MainForm : MetroForm { public MainForm() { InitializeComponent(); metroStyleManager.Theme = MetroThemeStyle.Default; metroStyleManager.Style = MetroColorStyle.Teal; } private void metroTileSwitch_Click(object sender, EventArgs e) { var m = new Random(); int next = m.Next(0, 13); metroStyleManager.Style = (MetroColorStyle)next; } private void metroTile1_Click(object sender, EventArgs e) { metroStyleManager.Theme = metroStyleManager.Theme == MetroThemeStyle.Light ? MetroThemeStyle.Dark : MetroThemeStyle.Light; } private void metroButton1_Click(object sender, EventArgs e) { MetroTaskWindow.ShowTaskWindow(this, "SubControl in TaskWindow", new TaskWindowControl(), 10); } private void metroButton2_Click(object sender, EventArgs e) { MetroMessageBox.Show(this, "Do you like this metro message box?", "Metro Title", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk); } private void metroButton5_Click(object sender, EventArgs e) { metroContextMenu1.Show(metroButton5, new Point(0, metroButton5.Height)); } private void metroButton6_Click(object sender, EventArgs e) { MetroMessageBox.Show(this, "This is a sample MetroMessagebox `OK` only button", "MetroMessagebox", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void metroButton10_Click(object sender, EventArgs e) { MetroMessageBox.Show(this, "This is a sample MetroMessagebox `OK` and `Cancel` button", "MetroMessagebox", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); } private void metroButton7_Click(object sender, EventArgs e) { MetroMessageBox.Show(this, "This is a sample MetroMessagebox `Yes` and `No` button", "MetroMessagebox", MessageBoxButtons.YesNo, MessageBoxIcon.Question); } private void metroButton8_Click(object sender, EventArgs e) { MetroMessageBox.Show(this, "This is a sample MetroMessagebox `Yes`, `No` and `Cancel` button", "MetroMessagebox", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); } private void metroButton11_Click(object sender, EventArgs e) { MetroMessageBox.Show(this, "This is a sample MetroMessagebox `Retry` and `Cancel` button. With warning style.", "MetroMessagebox", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning); } private void metroButton9_Click(object sender, EventArgs e) { MetroMessageBox.Show(this, "This is a sample MetroMessagebox `Abort`, `Retry` and `Ignore` button. With Error style.", "MetroMessagebox", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error); } private void metroButton12_Click(object sender, EventArgs e) { MetroMessageBox.Show(this, "This is a sample `default` MetroMessagebox ", "MetroMessagebox"); } private void metroButton4_Click(object sender, EventArgs e) { var testform = new TestForm1(); testform.ShowDialog(); } private void metroButton4_Click_1(object sender, EventArgs e) { metroTextBox2.Focus(); } } }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值