System.Windows.Forms.Control.SetBounds C# (CSharp) Method

SetBounds() public method

public SetBounds ( int x, int y, int width, int height, BoundsSpecified specified ) : void
x int
y int
width int
height int
specified BoundsSpecified
return void
		public void SetBounds(int x, int y, int width, int height, BoundsSpecified specified) {
			// Fill in the values that were not specified		
			
			if ((specified & BoundsSpecified.X) == 0)
				x = Left;
			if ((specified & BoundsSpecified.Y) == 0)
				y = Top;
			if ((specified & BoundsSpecified.Width) == 0)
				width = Width;
			if ((specified & BoundsSpecified.Height) == 0)
				height = Height;
		
			SetBoundsInternal (x, y, width, height, specified);
		}
		

Same methods

Control::SetBounds ( int x, int y, int width, int height ) : void

Usage Example

Example #1
0
 public static void CallControlSetBounds(Control c, object[] obj)
 {
     if (obj.Length == 4)
     {
         c.SetBounds((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3]);
     }
     if (obj.Length == 5)
     {
         c.SetBounds((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3],
                     (BoundsSpecified)obj[4]);
     }
 }
All Usage Examples Of System.Windows.Forms.Control::SetBounds
Control