Podcast
Questions and Answers
What is the purpose of option buttons in Visual Basic?
What is the purpose of option buttons in Visual Basic?
Option buttons allow the user to choose only one among the many choices.
How are Option Buttons different from Checkboxes?
How are Option Buttons different from Checkboxes?
Option buttons allow the user to choose only one among the many choices, while checkboxes allow for multiple selections.
Which control is another name for Option Buttons?
Which control is another name for Option Buttons?
Option buttons should be grouped with the use of _____________.
Option buttons should be grouped with the use of _____________.
Signup and view all the answers
What property allows users to give a name to each of the option buttons?
What property allows users to give a name to each of the option buttons?
Signup and view all the answers
What is the function of the cls
method in the Picture control?
What is the function of the cls
method in the Picture control?
Signup and view all the answers
The Image Control has the property autosize
to fit the picture to the sides of the borders.
The Image Control has the property autosize
to fit the picture to the sides of the borders.
Signup and view all the answers
What is the purpose of the Timer control's Interval
property?
What is the purpose of the Timer control's Interval
property?
Signup and view all the answers
The _________ and _________ scrollbars enable the user to set the value position of a picture on an item at the desired location.
The _________ and _________ scrollbars enable the user to set the value position of a picture on an item at the desired location.
Signup and view all the answers
What is the course module focused on?
What is the course module focused on?
Signup and view all the answers
What is the course code for the module?
What is the course code for the module?
Signup and view all the answers
How can the course packet be further improved?
How can the course packet be further improved?
Signup and view all the answers
What is the inquiry about enhancing the course packet?
What is the inquiry about enhancing the course packet?
Signup and view all the answers
If True, a menu item can be selected.
If True, a menu item can be selected.
Signup and view all the answers
The input box function displays a messagebox that will display a message or prompt with the textbox control when the user enters a value. The syntax for the input box function is $Variable = InputBox(“Prompt”, “Title”, “Default”, Xpos, Ypos)$
. The value entered inside the input box will be the value of the _______ variable.
The input box function displays a messagebox that will display a message or prompt with the textbox control when the user enters a value. The syntax for the input box function is $Variable = InputBox(“Prompt”, “Title”, “Default”, Xpos, Ypos)$
. The value entered inside the input box will be the value of the _______ variable.
Signup and view all the answers
Which statement is true about the Progressbar control?
Which statement is true about the Progressbar control?
Signup and view all the answers
Match the following Common Dialog Box methods with their corresponding dialog box:
Match the following Common Dialog Box methods with their corresponding dialog box:
Signup and view all the answers
What property sets the value to True if the radio button is selected?
What property sets the value to True if the radio button is selected?
Signup and view all the answers
Which values are used to represent Checked, Unchecked or Grayed in checkboxes?
Which values are used to represent Checked, Unchecked or Grayed in checkboxes?
Signup and view all the answers
What property is used to group related controls on a form?
What property is used to group related controls on a form?
Signup and view all the answers
What control presents a list of choices displayed vertically?
What control presents a list of choices displayed vertically?
Signup and view all the answers
Dropdown Combo and Simple Combo are the same in appearance.
Dropdown Combo and Simple Combo are the same in appearance.
Signup and view all the answers
What is the caption for Form1?
What is the caption for Form1?
Signup and view all the answers
What is the caption of Label 1 in Form1?
What is the caption of Label 1 in Form1?
Signup and view all the answers
The Timer 1 in Form1 has an interval of 100.
The Timer 1 in Form1 has an interval of 100.
Signup and view all the answers
The _ has a minimum value of 0 in Form1.
The _ has a minimum value of 0 in Form1.
Signup and view all the answers
Match the following Form names with their captions:
Match the following Form names with their captions:
Signup and view all the answers
What are the two ways in which the Save File box is commonly configured?
What are the two ways in which the Save File box is commonly configured?
Signup and view all the answers
When saving a file again in the Save configuration, what should appear in the FileName property?
When saving a file again in the Save configuration, what should appear in the FileName property?
Signup and view all the answers
What should the user do when closing the Save File box?
What should the user do when closing the Save File box?
Signup and view all the answers
What components are used in Form 1 of the flight planner application?
What components are used in Form 1 of the flight planner application?
Signup and view all the answers
Which of the following components are used in Form 2 of the flight planner application?
Which of the following components are used in Form 2 of the flight planner application?
Signup and view all the answers
What component is used in Form 3 of the flight planner application?
What component is used in Form 3 of the flight planner application?
Signup and view all the answers
What is the purpose of the Student Profile Program?
What is the purpose of the Student Profile Program?
Signup and view all the answers
List the input options required in the Student Profile Program.
List the input options required in the Student Profile Program.
Signup and view all the answers
What are the components used in designing the interface of the Student Profile Program?
What are the components used in designing the interface of the Student Profile Program?
Signup and view all the answers
What are the four main criteria in the rubrics for grading the Visual Basic program?
What are the four main criteria in the rubrics for grading the Visual Basic program?
Signup and view all the answers
What method does the Picture control support for clearing or erasing text, graphics, or graphics displayed on the screen?
What method does the Picture control support for clearing or erasing text, graphics, or graphics displayed on the screen?
Signup and view all the answers
Which file formats are supported by the Picture control for displaying images or pictures?
Which file formats are supported by the Picture control for displaying images or pictures?
Signup and view all the answers
The Image control has the property 'autosize' to fit the picture to the sides of the borders.
The Image control has the property 'autosize' to fit the picture to the sides of the borders.
Signup and view all the answers
The timer control event happens at a certain time interval measured in ______________.
The timer control event happens at a certain time interval measured in ______________.
Signup and view all the answers
Match the following scrollbar properties/methods with their descriptions:
Match the following scrollbar properties/methods with their descriptions:
Signup and view all the answers
What is the primary purpose of the Menu Editor in Visual Basic?
What is the primary purpose of the Menu Editor in Visual Basic?
Signup and view all the answers
Study Notes
Course Packet 03: Enhancing Program and Object Management
- This course packet introduces students to different controls and objects for data input and output in a Visual Basic application.
- The course packet covers various controls, including option buttons, checkboxes, combo boxes, list boxes, common dialog boxes, and others.
- Students will learn about event procedures of these controls and gain hands-on experience in data manipulation and enhancing the user interface in a Visual Basic application.
Objectives
- Determine the functions and usage of other controls in a program.
- Design a simple gender-inclusive Visual Basic application that uses different controls and has an engineering application.
Course Module: Computer Programming
- A control is an object that can be drawn on a Form object to enable or enhance user interaction with an application.
- Controls are broadly classified as standard controls, ActiveX controls, and insertable objects.
- Standard controls include CommandButton, Label, and Frame controls, which are contained inside an .EXE file and cannot be removed.
- ActiveX controls exist as separate files with .VBX or .OCX extensions.
Controls
- Option Button:
- Allows the user to select one option from a set of choices.
- Also known as radio buttons.
- Grouped using frames, allowing the user to choose only one among the available choices.
- Checkbox:
- Allows the user to choose multiple options from a set of choices.
- Values are set to 1 for true or 0 for false, or 2 for grayed out.
- Frames:
- Provide a way of grouping related controls on a form.
- Affect how option buttons operate within a group.
- Frames can be drawn within other frames.
- Listbox:
- Presents a list of choices displayed vertically in a column.
- A scroll bar appears if the list exceeds the height of the list box.
- Syntax for adding, deleting, and selecting items in a list box is provided.
Properties and Methods
-
Option Button:
- Name: allows the user to give a name to each option button.
- Caption: displays text to a certain option button.
- Value: sets the value to true or false if the button is selected or not.
-
Checkbox:
- Name: allows the user to give a name to each checkbox.
- Caption: displays text to a certain checkbox.
- Value: sets the value to 1 for true, 0 for false, or 2 for grayed out.
-
Frames:
- Caption: title information at the top of the frame.
- Font: sets font type, style, and size.
-
Listbox:
- AddItem: procedure to add items inside the list box.
- Clear: procedure to remove all items from the list box.
- Index: specifies the control array index.
- List: returns/sets the items contained in a control's list portion.
- ListCount: contains the number of items inside the list box.
- ListIndex: returns the number of the most recently selected item in the list.
- MultiSelect: controls how items may be selected.
- RemoveItem: procedure for removing or deleting an item inside the list box.
- Selected: array with elements set equal to true or false, depending on whether the corresponding list item is selected.### List Box and Combo Box
-
List box and combo box are two types of controls that present a set of choices to the user, displayed vertically in a column.
-
The main difference between the two is the appearance of the control: the combo box includes a text box on top of a list box and only allows the selection of one item.
-
Syntax for adding an item to a list box or combo box:
controlname.AddItem list
-
Syntax for deleting an item from a list box or combo box:
controlname.RemoveItem controlname.ListIndex
-
Syntax for deleting all items from a list box or combo box:
controlname.Clear
Combo Box Properties
-
AddItem
: adds an item to the list box -
Clear
: removes all items from the list box -
Index
: specifies the control array index -
List
: returns/sets the items contained in a control's list portion -
ListCount
: contains the number of items inside the combo box -
ListIndex
: returns the number of the most recently selected item in the list -
RemoveItem
: removes an item from the list box -
Selected
: returns an array with elements set equal to True or False, depending on whether the corresponding list item is selected -
Sorted
: sorts the list inside the control in ascending order -
Style
: specifies the style of the combo box (Dropdown Combo, Simple Combo, or Dropdown List)
Picture Control
- Used to display images or pictures in a program
- Supports many graphic formats, including bitmaps, GIF, JPEG, and metafiles
- Syntax for loading a picture:
Picturebox.Picture = LoadPicture(“Path and Filename”)
- Syntax for unloading a picture:
Picturebox.Picture = LoadPicture(“”)
- Syntax for clearing the picture:
Picturebox.cls
Image Control
- Similar to the picture control, but with fewer methods
- Loads pictures faster and consumes less memory space and system resources
- Supports bitmaps, JPEG, and GIF images
- Does not have the autosize property, instead uses the stretch property
- Syntax for loading and unloading pictures is the same as for picture control
Timer Control
- A control that is not visible at runtime
- Uses only one event, which is the Timer() event
- The event happens at a certain time interval, measured in milliseconds
- Property/Method:
Interval
(sets the time interval for the event)
Scrollbar
- There are two types of scrollbars: vertical and horizontal
- Enables the user to set its value to position a picture on an item at the desired location
- Properties/Methods:
-
LargeChange
: returns/sets the maximum amount of change to the value property in a scrollbar -
SmallChange
: returns/sets the minimum amount of change to the value property in a scrollbar -
Max
: returns/sets a scrollbar position's maximum value property setting -
Min
: returns/sets a scrollbar position's minimum value property setting
-
Multiple Forms
- Used when a program needs two or more forms
- Loading and unloading functions are important in multiple forms
- Properties/Methods:
-
Load
: loads a form into memory -
Show
: displays a form on the screen -
Unload
: unloads a form from memory -
Hide
: hides a form on the screen, but it is still loaded in memory
-
Menus
- A group of related commands
- Can be created using the Menu Editor
- Menu structure is a hierarchical list of command buttons
- Each menu item has a Click event associated with it
- Properties/Methods:
-
Caption
: the text that appears in the menu bar -
Name
: the control name for each menu item -
Index
: used for indexing any menu items defined as control arrays -
Shortcut
: assigns a shortcut keystroke to a menu item
-
Input Box Function
- Displays a messagebox with a prompt and a textbox
- Syntax:
Variable = InputBox(“Prompt”, “Title”, “Default”, Xpos, Ypos)
- Arguments:
-
Prompt
: the message displayed inside the input box -
Title
: the title of the input box -
Default
: the default message displayed inside the textbox -
Xpos, Ypos
: the coordinates where the input box will appear on the screen### Toolbar and Imagelist
-
- The toolbar is a control located below the menu bar, consisting of a collection of buttons that serve as shortcuts to menu bar commands.
- Imagelist is a control used to hold pictures for other controls, and is not visible at runtime.
- To insert a picture inside a toolbar, an imagelist must be added inside the form.
Statusbar
- The statusbar is a control located at the bottom of an application's window, used to display the status of the user's work and actions.
- The
Statusbar.Panels(n)
property is used to set the statusbar's panels, wheren
is the index of the panels. - To insert panels, right-click on the statusbar control and choose the property, then select the Panels tab to set the number of panels needed.
Common Dialog Boxes
- Common dialog boxes provide a standard interface for common operations in Windows-based applications.
- Visual Basic provides a set of common dialog boxes, including Open and Save As dialog boxes.
- The Common Dialog control is a custom control that requires additional files to be used.
- If the common dialog box does not appear in the Visual Basic toolbox, it can be added by selecting Components under the Project menu and clicking on Microsoft Common Dialog Control.
Common Dialog Box Methods
- There are five 'Show' methods to invoke the common dialog box at runtime:
-
ShowOpen
: displays the Open dialog box -
ShowSave
: displays the Save As dialog box -
ShowColor
: displays the Color dialog box -
ShowFont
: displays the Font dialog box -
ShowPrinter
: displays the Printer dialog box
-
Open Common Dialog Box
- The Open common dialog box allows users to specify the name of a file to open.
- The
ShowOpen
method is used to display the dialog box. - Properties of the Open common dialog box include:
-
CancelError
: generates an error if the Cancel button is clicked -
DialogTitle
: sets the title of the dialog box -
FileName
: sets the initial file name and returns the selected file name -
Filter
: restricts the filenames that appear in the file list box -
FilterIndex
: indicates which filter component is the default
-
Save As Common Dialog Box
- The Save As common dialog box allows users to specify the name of a file to save.
- The
ShowSave
method is used to display the dialog box. - Properties of the Save As common dialog box include:
-
CancelError
: generates an error if the Cancel button is clicked -
DialogTitle
: sets the title of the dialog box -
FileName
: sets the initial file name and returns the selected file name -
DefaultExt
: sets the default extension of a file name -
Filter
: restricts the filenames that appear in the file list box -
FilterIndex
: indicates which filter component is the default
-
Save File Configuration
- The Save File box can be configured in two ways:
- Save As configuration: used when saving a file for the first time, with a default file name in the
FileName
property - Save configuration: used when saving a file again, assuming the file has been previously opened with a name
- Save As configuration: used when saving a file for the first time, with a default file name in the
- When closing the Save File box, the application should check the returned file name to ensure it meets the required specifications before saving the file.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Understanding the purpose and properties of Option Buttons in Visual Basic, including their differences from Checkboxes and how to group them.