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 s You can manually change the size and position of your controls using the same syntax in the Designer file. s You have to use the Size and Point types defined in the System.Drawing library. s Size has public variables Width and Height. s 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 DocumentRight Arrow Icon
2 Moving Controls s The Location of a control is specified by the Point class. s 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). s Ex Move a button to position 100,100. button1.Location = new System.Drawing.Point(100, 100); s Ex Nudge a button to the right. button1.Location = new System.Drawing.Point (button1.Location.X+20, button1.Location.Y); X Y Positioning Controls s The units of measurement used for the locations are a little strange. s
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.

This note was uploaded on 05/18/2010 for the course PIC 10C taught by Professor Wittman during the Spring '10 term at UCLA.

Page1 / 5

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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online