问题描述
我有一个项目需要更改默认窗口最小化样式并添加新样式。新的风格,如Mac OS窗口最小化风格。
是否可以在C#中添加另一种最小化样式?如果可以改变最小化样式,那么请帮帮我..
谢谢代码项目!!谢谢大家!
I have a project which is need to change default window minimize style & add new style. New style such as- Mac OS window minimize style.
Is it possible to add another minimize style in C#? If is it possible to change the minimize style, so please help me..
Thanks Code Project!! Thanks Everybody!!
推荐答案
// some arbitrary size and location parameters
private Size customMinSize = new Size(100,100);
private Point customMinLocation = new Point(100, Screen.PrimaryScreen.WorkingArea.Height - 100);
// the SizeChanged EventHandler for the Form
private void Form1_SizeChanged(object sender, EventArgs e)
{
if (WindowState == FormWindowState.Minimized)
{
this.SuspendLayout();
this.WindowState = FormWindowState.Normal;
this.Size = customMinSize;
this.Location = customMinLocation;
this.ResumeLayout();
}
}
我强烈建议您认为用户已经社交化期望 Windows操作系统在某些方面表现得一致。
每当你改变一个基本的预期行为时,比如当窗口被最小化时会发生什么,你就会冒着混淆用户的风险。
I strongly suggest you consider that users are socialized to expect the Windows OS to behave in certain ways, consistently.
Any time you change a basic expected behavior, like what happens when a Window is minimized, you run the risk of confusing users.
这篇关于如何在C#中添加Mac OS最小化Windows窗体中的样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!