home *** CD-ROM | disk | FTP | other *** search
- frmEditor
- Text Editor: Untitled
- MS Sans Serif
- Form2
- txtEdit
- MS Sans Serif
- mnuFile
- &File
- mnuFileItem
- mnuFileItem
- &Open...
- mnuFileItem
- Save &As...
- mnuFileItem
- &Close
- mnuFileItem
- mnuFileItem
- E&xit
- mnuFileArray
- mnuEdit
- &Edit
- mnuEditItem
- mnuEditItem
- C&opy
- mnuEditItem
- &Paste
- mnuSettings
- &Settings
- mnuSettingsItem
- &Colors
- mnuColorsItem
- &BackColor
- mnuBackColorItem
- mnuBackColorItem
- &Green
- mnuBackColorItem
- &Blue
- mnuColorsItem
- &ForeColor
- mnuForeColorItem
- mnuForeColorItem
- &Green
- mnuForeColorItem
- &Blue
- mnuBlueItem
- &Light Blue
- mnuBlueItem
- &Dark Blue
- mnuDarkBlueItem
- &Sea Blue
- mnuDarkBlueItem
- &Midnight Blue
- mnuSettingsItem
- &Font Sizes
- mnuFontSizesItem
- mnuFontSizesItem
- mnuAbout
- &About...
- Form_Load
- Screen
- Height
- Left[
- Width
- Form_QueryUnload
- Cancel
- UnloadMode{
- DoUnLoadPreCheck
- Form_Resize
- txtEdit
- Scalewidth
- Scaleheight
- mnuAbout_Click
- CaptionText1
- CaptionText2
- CaptionText3
- CaptionText4
- CaptionText5
- frmAboutL
- lblAbout
- Caption
- mnuBackColorItem_Click
- Index
- BackColor
- mnuBlueItem_Click
- ForeColor
- mnuDarkBlueItem_Click6
- mnuEditItem_Click
- Clipboardw
- SelTexth
- mnuFileArray_ClickX
- OpenFile
- mnuFileArray
- mnuFileItem_Click
- filename
- frmEditor
- frmOpenSavee
- txtOpenSave
- SelLength,
- mnuFileItem@
- Enabled
- Closefile
- mnuFontsItem_ClickK
- mnuFontSizesItem_Click
- FontSize
- mnuFontSizesItem
- Checked
- mnuForeColorItem_Click
- txtEdit_Change
- txtEdit_KeyDown
- KeyCode
- Shift
- mnuEditItem
- mnuEdit_Click
- Form_Load
- Change working directory to the directory
- where the application was executed.
- The form is horizontally and vertically centered when loaded.
- Form_QueryUnload
- The general procedure DoUnLoadPreCheck handles the possible unload options.
- for all three forms in this sample application.
- Form_Resize
- mnuAbout_Click
- All the CaptionTextn string variables below are concatenated together with the appropriateg
- line feed characters to display text in the About dialog.
- This Text Editor sample application illustrates the various menu features available using Visual Basic, including...
- ...submenus, separator bars, access keys, shortcut keys, modal and modeless dialog boxes,
- MsgBox, showing and hiding forms, disabling controls, invisible controls, check marks,
- control arrays, and adding and removing menu controls at run time...
- ...and much, much, more!
- The Show method with style = 1 is used here to display the dialog as modal. Unloading the
- dialog is handled in the forms cmdOK_Click event procedure.
- mnuBackColorItem_Click
- Set BackColor to Red
- Set BackColor to Green
- Set BackColor to Blue
- mnuBlueItem_Click
- If Light Blue was selected then set the Forecolor to light.
- blue otherwise do nothing.
- mnuDarkBlueItem_Click
- Set ForeColor to Sea Blue
- Set ForeColor to Midnight Bluet
- mnuEdit_Click
- Disable Cut and Copy if no text selected.
- mnuEditItem_Click
- If Index = 0, user chose "Cut"t
- Copy selected text to Clipboard.i
- Clear selected text from the document.
- If Index = 1, user chose "Copy"
- Copy selected text to Clipboard.t
- If Index = 2, user chose "Paste"t
- Paste Clipboard text (if any) into document.g
- mnuFileArray_Click
- Open the selected file.
- mnuFileItem_Click
- Check index value of selected menu item.i
- If index = 0, the user chose "New"m
- Clear text box
- Untitled
- Set the title bar caption to "Text Editor: Untitled".
- Text Editor:
- If index = 1, the user chose "Open..."p
- Set caption of Open/Save dialog to "Open"
- Set default text in File Name text box.
- Show default text selected.
- Show the File Open dialog.
- If index = 2, the user chose "Save As..."
- Set caption of Open/Save dialog to "Save"
- Set default text in File Name text box.
- Show default text selected.
- Show the File Open dialog.e
- If index = 3, the user chose "Close"g
- Clear text box
- Text Editor: Untitled
- Refresh caption of form
- Disable this menu item.
- Close the current file.
- This menu item is a separator bar, no code needs to be written here
- because it cannot be selected and therefore cannot receive a Click event.
- If index = 5, the user chose "Exit"
- End this application and return to the Windows operating system.
- mnuFontSizesItem_Click
- Perform action based on Index property value of menu control
- If Index = 0 then user chose font size 12
- Set FontSize property of text box to 12
- Display check mark next to 12
- Remove check mark next to 242
- Set FontSize property of text box to 24
- Remove check mark next to 12b
- Display check mark next to 24
- mnuForeColorItem_Click
- Set ForeColor to Rede
- Set ForeColor to Green
- No code for this case because submenu is automatically displayed on Case 2.
-