C# GUI Forms / Inheritance / Polymorphism Flashcards

1
Q

What does the label control do?

A

Displays images or uneditable text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the TextBox control do?

A

Enables the user to enter data via the keyboard. It also can be used to display editable or uneditable text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the Button control do?

A

Triggers an event when clicked with the mouse.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the checkbox control do?

A

Specifies an option that can be selected (checked) or unselected (not checked)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the combobox control do?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the listbox control do?

A

Provides a list of items from which the user can make a selection by clicking one or more items.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the panel control do?

A

A container in which controls can be placed and organized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the numericupdown control do?

A

Enables the user to select from a range of numeric input values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a form?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What happens when you drag an item from the toolbox onto the form?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the accept button property?

A

Default button thats clicked when you press enter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the auto scroll property?

A

bool value (false by default) that allows or disallows scrollbars when needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the cancelbutton property?

A

Button thats clicked when the escape key is pressed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the formborderstyle property?

A

Border style for the form (sizable by default).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the font property?

A

Font of text displayed on the form, and the default font for controls added to the form.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the text property?

A

Text in the forms title bar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the close method?

A

Closes a form and releases all resources, such as the memory used for the forms content. A closed form cannot be reopened.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the hide button?

A

Hides a form, but does not destroy the form or release its resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does the show method do?

A

Displays hidden form.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does the load even do?

A

Occurs before a form is displayed to the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is an event handler?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What does an event handler look like?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How do you create the default event handler for a form control?

A

Double click on the form control.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are the two parameter every event handler receives when its called?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Where is the auto generated GUI code placed in visual studio?

A

in the Designer.cs file of the form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

How would you modify the GUI controls?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is a delegate?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is a multicast delegate?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is another way to create event handlers?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

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

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

How do you change the controls background colour?

A

with the BackColor property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

How do you edit the controls baground image?

A

with the BackgroundImage property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What does the enabled property do?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What does the focused property do?

A

Indicates whether the control has the focus (only available at runtime)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

how do you choose what font is used to display the controls text?

A

the font property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

How do you choose what the controls foreground color is?

A

The ForColor property. This usually determines the color of the text in the Text Property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

What does the TabIndex property do?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What does the TabStop property do?

A

If true, then a user can give focus to this control via the Tab key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

What does the text property do?

A

The text associated with control. The location and appearance of the text vary depending on the type of control.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What does the visible property do?

A

Indicates whether the control is visible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

What method hides the control?

A

The Hide method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

What method acquires the focus?

A

the Select method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What method shows the control?

A

the Show method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

What is anchoring and how does it work?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

What does the anchoring window look like?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What is docking?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

What does a docked control look like?

A
48
Q

What does the anchor property do?

A

Causes a control to remain at a fixed distance from the side(s) of the container even when the container is resized.

49
Q

What does the dock property do?

A

Allows a control to span one side of its container or to fill the remaining space in the container

50
Q

What does the Padding property do?

A

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.

51
Q

What does the location property do?

A

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.

52
Q

What does the size property do?

A

Specifies the size of the control in pixels as a Size object, which has properties Width and Height.

53
Q

What does the minimumSize/maximumSize methods do?

A

Indicates the minimum and maximum size of a control, respectively.

54
Q

What do snap lines do?

A
55
Q

What do labels do?

A

Labels display text that the user cannot directly modify

56
Q

What are some common label properties?

A
57
Q

What is a textbox?

A

A textbox is an area in which either text can be displayed by a program or the user can type text via the keyboard.

58
Q

How do you turn a textbox into a password textbox that hides the characters?

A

Set the property UseSystemPasswordChar to true

59
Q

What are some common properties / events in textboxes?

A
60
Q

What is a button?

A

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

61
Q

What are the common properties and click event for buttons?

A
62
Q

What are group boxes and panels?

A
63
Q

What are the common groupbox properties?

A

Controls - The set of controls that the groupbox contains

Text - Specifies the caption text displayed at the top of the Groupbox

64
Q

What are the common panel properties?

A

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.

65
Q

How would you create and use a groupbox or panel?

A
66
Q

What would the panel scrollbars look and act like?

A
67
Q

What are checkboxes?

A
68
Q

What are the common checkbox properties and events?

A
69
Q

How would you combine font styles with bitwise operators?

A
70
Q

What are radio buttons?

A
71
Q

When should you use radio buttons over checkboxes?

A

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.

72
Q

What are the radio buttons common properties and events?

A
73
Q

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

A
74
Q

What does a picture box control do?

A

Displays an image

75
Q

What are the common properties for the picturebox?

A
76
Q

What are teh common events for pictureboxes?

A
77
Q

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

A
78
Q

How would you add a resource and why?

A
79
Q

Where are a projects resources stored?

A
80
Q

What are tool tips?

A

The helpful text that appears when the mouse hovers over an item in a GUI

81
Q

What are the common properties and events for the tool tip

A
82
Q

Where does the tooltip component appear?

A
83
Q

What is the numericUpDown control?

A
84
Q

What are the common properties for NumericUpDown?

A
85
Q

What is the common event for the numericupdown?

A
86
Q

How are mouse events handled?

A
87
Q

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

A
88
Q

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

A
89
Q

What are the properties of class MouseEventArgs?

A
90
Q

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

A
91
Q

What are the three key events for keyboard even handling?

A
92
Q

What are the keyboard events and event arguments?

A
93
Q

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

A
94
Q

How would you cause a button to be clicked when the Enter key is pressed on a form?

A

Set the forms accept button properly

95
Q

What is specialization?

A

A derived class.

96
Q

How does generalization compare to specialization?

A

Base Class.

97
Q

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

A
98
Q

What is factoring?

A
99
Q

What would factoring look like in a uml class diagram?

A
100
Q

How do you hide the base class method?

A
101
Q

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

A
102
Q

How and why would you call the base class constructor?

A
103
Q

Can the derived class inherit the base constructor?

A

No.

104
Q

Is hiding a parent classes method the go to choice?

A
105
Q

How do you create and implement polymorphism?

A
106
Q

What is the difference between abstract and virtual methods?

A
107
Q

How do you override virtual methods?

A
108
Q

Can you override an overridden method?

A

Yes!

109
Q

How does versioning work with new and override?

A
110
Q

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

A
111
Q

How do you designate an abstract class and method?

A
112
Q

What is the idea behind abstraction?

A
113
Q

What are sealed classes and how do they work?

A
114
Q

What is the root of all classes: Object?

A
115
Q
A