views:

67

answers:

2

Hi

I am wondering 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

+4  A: 

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);

Webleeuw
err I should have said is it the same as doing Size and Point?
chobo2
Yes it is, maybe that would have been clearer to say :).
Webleeuw
A: 

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

CesarGon