1 / 12

Forms

Forms. 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. EVENT Form_Load Form_Unload Form_Activate Form_Deactivate Form_Resize.

snellerj
Télécharger la présentation

Forms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

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

More Related