Download
forms n.
Skip this Video
Loading SlideShow in 5 Seconds..
Forms PowerPoint Presentation

Forms

7 Views Download Presentation
Download Presentation

Forms

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Forms

  2. Forms have - • Properties • Events • Methods • Remember, a method is something the object does to itself. An example is a form printing on itself or a list adding or removing items to and from itself.

  3. EVENT Form_Load Form_Unload Form_Activate Form_Deactivate Form_Resize PURPOSE and USES Initialize variables and controls Keep things straight as form closes Whenever form is switched to Whenever form is switched from Whenever form is resized Form Events With Activate and Deactivate the form remains available to switch to and from

  4. Form Methods • frmMyForm.Show • frmMyForm.Hide • Shorthand method for changing the visible property.

  5. Form Properties • StartUpPosition 0 Unspecified • Center of Current (Owner) Form • Center of Screen • Upper Left

  6. Form Properties • ScaleMode • Twips 4 Characters

  7. Form Properties • AutoRedraw T/F True tells the computer to redraw the form again every time it is accessed. Keeps graphics current and printing that form current.

  8. Icon MaxButton MinButton MousePointer WindowState NUMEROUS Appearance BackColor BorderStyle Caption ControlBox Enabled FontStyle Form Properties

  9. Form Collections • A collection is a group of like things that can be referred to in a like manner, much like an array. • Some collections are automatically generated: forms, objects on a form, etc • Forms(1), Forms(2), etc • intNumForms=Forms.Count Gives the number of Forms

  10. Control Collections • intNumberOfControls = _frmMyForm.Count

  11. Printing on forms • Switch ScaleMode to 4 – Characters • frmMyForm.Print “This is a method” • .CurrentX and .CurrentY • Put a colon (;) to keep the next text on the same line • Spc(x), Tab(x) for Spaces and Tab

  12. For Each • The For Each loop is like a for next loop, but is used with collections. For Each Whatever in frmMyForm Whatever.Enabled=false Next