1 / 5

Chapter 5 - Menus, Sub Procedures, and Sub Functions

Chapter 5 - Menus, Sub Procedures, and Sub Functions. Menus - controls - properties and events menu editor - create and change defining menus - menu commands, submenus, keyboard access keys caption and name required mnu - levels of menu separator bars coding - click event

lilike
Télécharger la présentation

Chapter 5 - Menus, Sub Procedures, and Sub Functions

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. Chapter 5 - Menus, Sub Procedures, and Sub Functions • Menus - controls - properties and events • menu editor - create and change • defining menus - menu commands, submenus, keyboard access keys • caption and name required • mnu - levels of menu • separator bars • coding - click event • toggling check marks • standards

  2. Common dialog boxes - windows environment - predefined • using • writing general procedures - sub procedures or functions - reusable • subprocedure - performs function • function - returns a value • large sections of code broken down into smaller sections • Tools/add - not an event - called

  3. passing variables - keep scope as narrow as possible • byval and byref • Functions • predefined • user-defined - arguments • multiple arguments • Executable files

  4. #10 - Pg. 203, 5.3 • Input sales, person name, and weekly sales, calculate commission – function – pg. 189, display pay – commission and total pay – if no commission – do not display $0 commission, about moved over, access keys, summary – total sales commission, pay – format number, 2 – no $ - in message box, module and local variables, constants in function, skip font menu, color – must make show – generate common dialog control, name – affect forecolor; design, code, form, form as text, output with summary – printscreen, message box string – joining several together – pg. 140, clear – reset focus, Sandy - $400, Sam - $250, Joe - $550 • pg. 240, rev. questions 1-7

  5. 5.3 • Function – sales – local variable • Constants for commission rate and quota • If sales > quota • Commission = sales * rate • Display commission • Add to module variable • Else • Commission = $0 • Commission not display • End if • Pay • Local variables – pay, sales, constant – base pay • Enter sales • Check if not 0 • Calculate pay with function – sales sent • Display pay • Add to total pay and sales • Summary • Display summary info in message box • Clear • Clear text boxes and labels, set focus • Color – common dialog box, label = color chosen

More Related