What does Bounds do? windows mobile C#
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.
精彩评论