Resizing the form elements on resizing the form

女生的网名这么多〃 提交于 2019-12-13 02:27:54

问题


how to Resizing the Windows form elements on resizing the form? is there any way to set the width of picturebox, panel, etc 100% like CSS? suggest me some help for best practices of layout? When i resize the Windows form, I want that Image size also change when i resize the image. like Windows Picture Viewer


回答1:


You would probably be okay with the Anchor property of the controls.

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.anchor(v=vs.71).aspx




回答2:


You should look into Control Docking, it'll probably suit your needs.




回答3:


What you may want is to set the properties of the image control to fill the image inside.

Steps:

  1. I created a new windows form
  2. I added a picture box to the form
  3. I set the picture box "Dock" property to "Fill"
  4. I added an image to the picture box
  5. I set the SizeMode property to "StretchImage" ("Zoom" might better fit your needs")


来源:https://stackoverflow.com/questions/8070139/resizing-the-form-elements-on-resizing-the-form

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!