1 / 12

Chapter 8 : Security, Menus, and Files

Chapter 8 : Security, Menus, and Files. Passwords are often used to control access to a computer or software program. Passwords should be at least 6 characters in length and something that cannot be easily guessed.

vic
Download Presentation

Chapter 8 : Security, Menus, and Files

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 8:Security, Menus, and Files Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  2. Passwords are often used to control access to a computer or software program. Passwords should be at least 6 characters in length and something that cannot be easily guessed. It should not be possible to move, resize, or bypass the password form in VB and it should be the Startup object. The Tag property for a textbox can be used for the password and the PasswordChar property can be used to disguise the password as it is entered. A user should be given a set number of “chances” to enter the correct password. Security Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  3. A menu system for a form can be created using the Menu Editor. Menu bar options as well as submenus can be created with this editor. Menu and submenu items have caption and name properties (the prefix is mnu). Code is written for menu items just like for other event procedures. Menu options are always click events. Most menus contain File and Help menu bar options in addition to others specific to the application. Menu Systems in VB Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  4. Menu Editor Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  5. Creating a memo editor in VB involves using a textbox as the location of the text and a menu system for the various editor commands. The textbox should have its MultiLine property set to true and its ScrollBars property set to vertical. The Form_Resize event occurs when the user displays a textbox--it can be used to cause the memo text box to fill its form by setting the Height and Width properties to ScaleHeight and ScaleWidth. Creating a Memo Editor Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  6. The File Menu should have options to begin a new memo, open an existing memo, save a memo under the current name or a new one, close the memo, print it, or exit the memo editor. Key to the File Menu is the use of the common dialog control which must be added to the Toolbar with the Project|Components VB menu option before being added to the form. The common dialog control (with dlg prefix) can be used to open or save files with the ShowOpen and ShowSave methods. The Memo Editor File Menu Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  7. Plan for Vintage Videos Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  8. The Filter property of the common dialog control is used to display a list of files. It has the form: dlgName.Filter = “description1|filter1|description2|filter2|etc” The FilterIndex property determines the default file type. When a file is selected or a filename entered, this becomes the Filename property for the dialog box. The FreeFile function returns an unused file number and the On Error Goto statement causes control to jump to a label when an error is encountered. Both are useful in working with files. Saving a Memo Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  9. A file can be opened from a common dialog box with the ShowOpen method. The contents of the file can be input using the Input$ function: Input$(number, #filenumber) where number = number of characters in file that is identified by #filenumber. The LOF(FileNumber) function can be used to determine the number of characters in a file. A memo can be saved by printing its contents to a file—it is common to query the user to save the file if it has been changed. Other File Operations Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  10. Typical editing options are Cut, Copy, and Paste. All three use the Clipboard object to temporarily save information. The Clipboard SetText method transfers selected text to the clipboard and the GetText method retrieves text from clipboard. The Clipboard Clear method clears the Clipboard. The Memo Editing Submenu Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  11. Using the Clipboard Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

  12. Formatting of text in the memo involves changing the Font and Style of the text. Menu control arrays are used to display different types of fonts and styles. The FontName property of the memo textbox determines the font type. FontBold, FontItalics, FontUnderline properties of the textbox control the style of the text. The Memo Format Submenu Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy

More Related