[转]C# WinForm 关于窗体最大化时的是否全屏效果与是否遮盖任务栏
0.新建窗體 及添加按鈕
1.ITPUB個(gè)人空間s6d:vU0UL
? 執(zhí)行如下按鈕事件ITPUB個(gè)人空間zA\I;^+M,g"pr Q0J
? private void btnFormMax_Click(object sender, EventArgs e)
+tbh5?'e0? {ITPUB個(gè)人空間&MK4ozc;FP
???? if (this.WindowState == FormWindowState.Maximized)
b x?p#p,H8t0???? {ITPUB個(gè)人空間2LM.[3]M
???????? this.WindowState = FormWindowState.Normal;
.b�ev~q[-@!O0???? }
r(Iem4{#bg0???? elseITPUB個(gè)人空間k$lV&Rohu
???? {ITPUB個(gè)人空間W8^wm|�qy @
???????? this.WindowState = FormWindowState.Maximized;ITPUB個(gè)人空間^0vQ9h ^
???? }ITPUB個(gè)人空間x:h;f'Au9P9ZO_
? }ITPUB個(gè)人空間J,p/X/F9or
? 窗體最大化時(shí) 非全屏 不會(huì)遮蓋任務(wù)欄
q@/xc^v6[Px0? 此時(shí)this.FormBorderStyle. 默認(rèn)為 Sizable
2.ITPUB個(gè)人空間3U&u9])_0dn*c
? 執(zhí)行如下按鈕事件ITPUB個(gè)人空間[#U%tsT:N%|
? private void btnFormMax_Click(object sender, EventArgs e)ITPUB個(gè)人空間:\,l!x-j(_"Qw
? {
NNYi C0^FV$Ln�_lY0????? if (this.WindowState == FormWindowState.Maximized)
|GQ2p7}O!pT0????? {???????
%m]5|vlF0???????? this.WindowState = FormWindowState.Normal;
O*L^*M$l4Md�Jf(zx0????? }ITPUB個(gè)人空間\ h'H ~;~
????? else
7elW$Ii0????? {
|B}@+V}1n qAC0???????? this.FormBorderStyle. = FormBorderStyle.None;
\/g0o&KB t0w0???????? this.WindowState = FormWindowState.Maximized;
EcN%WQ�l}B0????? }
\+YN0LC0?? }
? 窗體最大化時(shí) 會(huì)全屏 及遮蓋任務(wù)欄
6F0S+N M7[0? 此時(shí)this.FormBorderStyle. 為 None 不會(huì)顯示窗體標(biāo)題欄等相關(guān)
3.
KAK Y0HmNF0? 執(zhí)行如下按鈕事件
~3Eo3NTp0? private void btnFormMax_Click(object sender, EventArgs e)
1nU|5\8AO?-~H0? {ITPUB個(gè)人空間}"F#M#X1k0c�X
????? if (this.WindowState == FormWindowState.Maximized)ITPUB個(gè)人空間,B'BC;bzE*a c�xZ
????? {???????ITPUB個(gè)人空間iGj]g+Y%L+IE
???????? this.WindowState = FormWindowState.Normal;
5b%t+l.X @(zl/e0????? }ITPUB個(gè)人空間/wC ZcWg
????? elseITPUB個(gè)人空間?m{!SrPy7p
????? {ITPUB個(gè)人空間Qt ^f\
???????? this.FormBorderStyle. = FormBorderStyle.None;
;pCy*cy'p Z)g0???????? this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);ITPUB個(gè)人空間\Qh9q cn-oc
???????? this.WindowState = FormWindowState.Maximized;
v1y,c8Rw0????? }ITPUB個(gè)人空間7y6LOQ&mhHK�s#Y
?? }
/E+GQKc5fIy]0? 此時(shí)this.FormBorderStyle. 為 None 不會(huì)顯示窗體標(biāo)題欄等相關(guān)
轉(zhuǎn)載自: http://space.itpub.net/12639172/viewspace-501587
轉(zhuǎn)載于:https://www.cnblogs.com/JinDin/archive/2009/08/12/1544509.html
總結(jié)
以上是生活随笔為你收集整理的[转]C# WinForm 关于窗体最大化时的是否全屏效果与是否遮盖任务栏的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 推荐.NET CF控件(Resco Mo
- 下一篇: GridView的翻页