开发者

What does Bounds do? windows mobile C#

开发者 https://www.devze.com 2022-12-14 02:28 出处:网络
I am wonderi开发者_StackOverflow社区ng what does \"Bounds\" do? like you can do label1.Bounds = new Rectangle(100,100,100,100);

I am wonderi开发者_StackOverflow社区ng what does "Bounds" do?

like you can do

label1.Bounds = new Rectangle(100,100,100,100);

I can't find any information on it(seems sometimes so hard to find information for windows mobile stuff).

Does bounds include "Size"?

Like would it be redundant to do this?

label1.Size = new Size(100, 100);
label1.Bounds = new Rectangle(100,100,100,100);

Thanks


It defines the left, top, width and height of your label.

Left and top are the relative location to the parent control and width and height are the sizes in pixels.

See also the Rectangle data in Visual Studio (or reflector):

public Rectangle(int x, int y, int width, int height);


Bounds specifies the bounds of the control, i.e. its top, left, width and height. Check out MSDN page for the Control.Bounds property.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号