如何在窗体中心(图片框)居中(图片框)? [英] How Can I Center (Picture Box) In The Center Of Form ?

查看:149
本文介绍了如何在窗体中心(图片框)居中(图片框)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

欢迎大家,



我如何将中心(图片框)置于窗体的中心?

welcome everyone ,

How can i center (picture box) in the center of form ??

推荐答案

将控件放在中心格式 - >格式中心 - >水平和垂直

并设置< b> Anchor 属性为
Place the control on the center(format -> center in form ->horizontal and vertical)
and set Anchor property to None.


如果在实时(调试时)需要这个,则需要输入此代码。如果PictureBox1在Form1上。



If you need this on Real Time (when debugging) you need to put this code. if the PictureBox1 is on Form1.

PictureBox1.Location = New Point((Form1.Width / 2)-(PictureBox1.Width / 2), (Form1.Height / 2)-(PictureBox1.Height / 2)





这段代码会实时将PictureBox放在窗体的中心(调试时间)。

!如果让用户放弃,你需要这个在调试中更改表单大小。



This code will make the PictureBox in the Center of the form in real time (Debug time).
! You need this if you are letting the user to change the form size in the debugging.


这篇关于如何在窗体中心(图片框)居中(图片框)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆