{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lec11 - Lecture 11 Creating Controls PIC 10C Todd Wittman...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lecture 11: Creating Controls PIC 10C Todd Wittman Resizing Controls square6 You can manually change the size and position of your controls using the same syntax in the Designer file. square6 You have to use the Size and Point types defined in the System.Drawing library. square6 Size has public variables Width and Height. square6 Ex Resize a button button1.Size = new System.Drawing.Size(100, 100); button1.Size = new System.Drawing.Size (button1.Size.Width * 2, button1.Size.Height);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Moving Controls square6 The Location of a control is specified by the Point class. square6 The X,Y coordinates of the Point indicate the position of the top left corner of the control from the top left corner of the container (form). square6 Ex Move a button to position 100,100. button1.Location = new System.Drawing.Point(100, 100); square6 Ex Nudge a button to the right. button1.Location = new System.Drawing.Point (button1.Location.X+20, button1.Location.Y); X Y Positioning Controls square6 The units of measurement used for the locations are a little strange.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}