C# GUI Forms / Inheritance / Polymorphism Flashcards
What does the label control do?
Displays images or uneditable text.
What does the TextBox control do?
Enables the user to enter data via the keyboard. It also can be used to display editable or uneditable text.
What does the Button control do?
Triggers an event when clicked with the mouse.
What does the checkbox control do?
Specifies an option that can be selected (checked) or unselected (not checked)
What does the combobox control do?
Provides a drop-down list of items from which the user can make a selection either by clicking an item in the list or by typing in a box.
What does the listbox control do?
Provides a list of items from which the user can make a selection by clicking one or more items.
What does the panel control do?
A container in which controls can be placed and organized
What does the numericupdown control do?
Enables the user to select from a range of numeric input values.
What is a form?

What happens when you drag an item from the toolbox onto the form?
Visual studio generates code that created the object and set its basic properties. The IDE maintains the generated code in a separate file using partial classes
What is the accept button property?
Default button thats clicked when you press enter
What is the auto scroll property?
bool value (false by default) that allows or disallows scrollbars when needed.
What is the cancelbutton property?
Button thats clicked when the escape key is pressed
What is the formborderstyle property?
Border style for the form (sizable by default).
What is the font property?
Font of text displayed on the form, and the default font for controls added to the form.
What is the text property?
Text in the forms title bar
What is the close method?
Closes a form and releases all resources, such as the memory used for the forms content. A closed form cannot be reopened.
What is the hide button?
Hides a form, but does not destroy the form or release its resources.
What does the show method do?
Displays hidden form.
What does the load even do?
Occurs before a form is displayed to the user.
What is an event handler?
GUIs are event driven. When the user interacts with a GUI component, the event drives the program to perform a task. A method that performs a task in response to an even it called an event handler.
What does an event handler look like?

How do you create the default event handler for a form control?
Double click on the form control.
What are the two parameter every event handler receives when its called?

Where is the auto generated GUI code placed in visual studio?
in the Designer.cs file of the form
How would you modify the GUI controls?

What is a delegate?

What is a multicast delegate?

What is another way to create event handlers?
Another Way to Create Event Handlers is Using the Properties Window to Create Event Handlers Controls can generate many different events. Clicking the Events icon (the lightning-bolt icon) in the Properties window (Fig. 14.8), displays all the events for the selected control.

How do you search for a controls documentation in Visual Studio?

How do you change the controls background colour?
with the BackColor property
How do you edit the controls baground image?
with the BackgroundImage property
What does the enabled property do?

What does the focused property do?
Indicates whether the control has the focus (only available at runtime)
how do you choose what font is used to display the controls text?
the font property
How do you choose what the controls foreground color is?
The ForColor property. This usually determines the color of the text in the Text Property
What does the TabIndex property do?
The tab order of the control. Then the tab key is pressed, the focus transfers between controls based on the tab order. You can set this order.
What does the TabStop property do?
If true, then a user can give focus to this control via the Tab key
What does the text property do?
The text associated with control. The location and appearance of the text vary depending on the type of control.
What does the visible property do?
Indicates whether the control is visible
What method hides the control?
The Hide method
What method acquires the focus?
the Select method
What method shows the control?
the Show method
What is anchoring and how does it work?

What does the anchoring window look like?

What is docking?

What does a docked control look like?

What does the anchor property do?
Causes a control to remain at a fixed distance from the side(s) of the container even when the container is resized.
What does the dock property do?
Allows a control to span one side of its container or to fill the remaining space in the container
What does the Padding property do?
Sets the space between a container’s edges and docked controls. The default is 0, causing the control to appear flush with the container’s side.
What does the location property do?
Specifies the location (as a set of coordinates) of the upper-left corner of the control, in relation to its container’s upper-left corner.
What does the size property do?
Specifies the size of the control in pixels as a Size object, which has properties Width and Height.
What does the minimumSize/maximumSize methods do?
Indicates the minimum and maximum size of a control, respectively.
What do snap lines do?

What do labels do?
Labels display text that the user cannot directly modify
What are some common label properties?

What is a textbox?
A textbox is an area in which either text can be displayed by a program or the user can type text via the keyboard.
How do you turn a textbox into a password textbox that hides the characters?
Set the property UseSystemPasswordChar to true
What are some common properties / events in textboxes?

What is a button?
A button is a control that the user clicks to trigger a specific action or to select an option in a program. A program can user several types of buttons, but all the button classes derive from class ButtonBase
What are the common properties and click event for buttons?

What are group boxes and panels?

What are the common groupbox properties?
Controls - The set of controls that the groupbox contains
Text - Specifies the caption text displayed at the top of the Groupbox
What are the common panel properties?
AutoScroll - Indicates whether scrollbars appear when the panel is too small to display all of its controls. The default value is false.
BorderStyle - Sets the border of the Panel. The default value is none; other options are Fixed3D and FixedSingle.
Controls - The set of controls that the Panel contains.
How would you create and use a groupbox or panel?

What would the panel scrollbars look and act like?

What are checkboxes?

What are the common checkbox properties and events?

How would you combine font styles with bitwise operators?

What are radio buttons?

When should you use radio buttons over checkboxes?
When the user should choose only one option in a group. Checkboxes are when the user should be able to choose multiple options in a group.
What are the radio buttons common properties and events?

How would you change buttons based on option chosen by radio button?

What does a picture box control do?
Displays an image
What are the common properties for the picturebox?

What are teh common events for pictureboxes?

How would you retrieve an image from resources and load it into a picturebox?

How would you add a resource and why?

Where are a projects resources stored?

What are tool tips?
The helpful text that appears when the mouse hovers over an item in a GUI
What are the common properties and events for the tool tip

Where does the tooltip component appear?

What is the numericUpDown control?

What are the common properties for NumericUpDown?

What is the common event for the numericupdown?

How are mouse events handled?

What are the mouse events with event argument of type eventargs?

What are the mouse events with event argument of type mouseeventargs?

What are the properties of class MouseEventArgs?

How and why using the USING which will Dispose a graphics object after?

What are the three key events for keyboard even handling?

What are the keyboard events and event arguments?

What would some code look like that displayed the current key press?

How would you cause a button to be clicked when the Enter key is pressed on a form?
Set the forms accept button properly
What is specialization?
A derived class.

How does generalization compare to specialization?
Base Class.

What would a UML class diagram of generalized and specialized classes look like?

What is factoring?

What would factoring look like in a uml class diagram?

How do you hide the base class method?

What would the code look like to hide the drawcontrol method?

How and why would you call the base class constructor?

Can the derived class inherit the base constructor?
No.

Is hiding a parent classes method the go to choice?

How do you create and implement polymorphism?

What is the difference between abstract and virtual methods?

How do you override virtual methods?

Can you override an overridden method?
Yes!

How does versioning work with new and override?

What is an abstract class and why do we use them?

How do you designate an abstract class and method?

What is the idea behind abstraction?

What are sealed classes and how do they work?

What is the root of all classes: Object?
