在.net4.0中制作自动灵活的Dekstop应用程序 [英] Make auto flexible dekstop application in .net4.0
本文介绍了在.net4.0中制作自动灵活的Dekstop应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用.net 4.0 c#开发Windows应用程序,我的问题是我无法以任何dekstop分辨率设置全屏.
如果我将窗口状态设置为最大化,则窗体将最大化,但未设置控件,它们看起来像是不受管理的.
请建议我...
Thankyou
Hi,
i am developing a windows application using .net 4.0 c# and my problem is i can''t able to set full screen in any dekstop resolution.
if i set window state to maximize then form goes to maximize but it''s control not set and they look like unmanaged.
kindly suggest me .....
thankyou
推荐答案
问题的表述方式不正确(请参阅我对问题的评论);我只是猜猜你是什么意思.
您需要开发一个体面的表单布局.没有绝对定位了;一切都应基于嵌套面板,面板和所有其他控件应使用属性System.Windows.Forms.Control.Dock
和System.Windows.Forms.Control.Padding
停靠,为表单设置适当的MinimumSize
和MaximumSize
等.
请参阅:
http://msdn.microsoft.com/en-us/library/system. windows.forms.control.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system. windows.forms.form.aspx [ ^ ].
有时,您还可以在运行时通过覆盖一个或多个虚拟方法(例如OnClientSizeChanged
,OnSizeChanged
,OnResize
,OnResizeBegin
,OnResizeEnd
)来调整布局,但是通常,如果布局足够简单且正确,没必要.
请查看我过去的答案:
当屏幕分辨率改变时,Zom Out发生故障 [ ^ ],
如何停靠按钮,以便它可以使用以下格式进行调整 [ GUI外观-C#.Net [
The question is not formulated correctly (please see my comment to the question); I can just guess what do you mean.
You need to develop a decent form layout. No absolute positioning anymore; everything should be based on nested panels, the panels and all other controls should be docked using the propertySystem.Windows.Forms.Control.Dock
andSystem.Windows.Forms.Control.Padding
, set appropriateMinimumSize
andMaximumSize
for the forms, etc.
Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspx[^].
Sometime you can also adjust layout during run time by overriding one or more of the virtual methods likeOnClientSizeChanged
,OnSizeChanged
,OnResize
,OnResizeBegin
,OnResizeEnd
, but usually, if layout is simple enough and correct, it won''t be necessary.
Please see my past answers:
Zom Out malfunctions when Screen resolution changes[^],
how to dock button so that it can adjust with the form[^] (will find a rudimentary code sample here).
See also:
GUI Apperance - C#.Net[^].
—SA
这篇关于在.net4.0中制作自动灵活的Dekstop应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文