Chapter 2: Intro to Visual C# Flashcards

1
Q

A visual C# application project starts with creating its GUI with:

A

1) Designer
2) Toolbox
3) Properties window

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

In the Designer, an empty form is automatically created

A

1) An application’s GUI is made of forms and controls
2) Each form and control in the application’s GUI must have aname as ID.

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

Each form and control in the application’s GUI must have aname as ID. The default blank form is named

A

“Form1” automatically

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

The default empty form has a dimension (size) of

A

Pixels wide by pixels high

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

A form in Designer is enclosed with

A

Thin dotted lines called the bounding box

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

The bounding box has small sizing handles; you can use them

A

To resize the form

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

The appearance and the other characteristics of a GUI object are determined by

A

The object’s properties

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

The Properties window lists all properties

A

When selecting an object, its properties are displayed in Properties windows

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

Each property has 2 columns

A
  1. Left: Property’s name
  2. Right: Property’s value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Changing a Property’s Value select an object, such as

A

The Form, by clicking it once

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

Click View and select Properties if the Properties window is

A

Not available

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

Find the property’s name in the list and change its value

A

1) The Text property determines the text to be displayed in the form’s title bar
2) Example: Change the value from “Form1” to “My First Program”

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

Adding Controls to a Form: In the Toolbox, select the Control, then you can either:

A
  1. Double click the Button control
  2. Click and drag the button control to the form
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

On the form, you can

A
  1. Resize the control using its bounding box and sizing handles
  2. Move the control’s position by dragging it
  3. Change its properties in the Properties window
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Rules for Naming Controls

A

Control’s names are identifiers of the controls

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

The naming convention are:

A

1) The first character must be a letter (lower or uppercase, does not matter) or an undercore
2) All other characters can be alphanumerical characters or underscores
3) The name cannot contain spaces

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

Creating the GUI for Your First Visual Application Component:

A

A form and a Button control

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

Creating the GUI for Your First Visual Application Component purpose:

A

1) Create the application’s GUI
2) Write the code that causes “Hello World” to appear when the user clicks the button (details are available in)

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

C# code is primarily organized in three ways:

A

1) Namespace: a container that holds classes
2) Class: a container that holds methods
3) Method: a group of one or more programming statements that perform some operations

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

A file that contains program code is called

A

A source code file

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

Each time a new project is created the following two source code files are automatically created:

A

1) Program.cs file
2) Form1.cs file

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

Program.cs file

A

Contains the application’s start up code to be executed when the application runs

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

Form1.cs file

A

Contain code that is associated with the Form1 form

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

A sample of Form1.cs:

A
  1. The using directives indicate which namespaces of .NET Framework this program will use
  2. The user-defined namespace of the project not .NET Framework namespaces
  3. Class declaration
  4. A method
25
C# code is organized as
Methods, which are contained inside classes, which are contained inside namespaces
26
GUI applications are event-driven which means they interact with
Users
27
A event is a user's action such as
Mouse clicking, key pressing, etc.
28
Double clicking a control, such as Button, will link the control to a default Event Handler
1) An event handler is a method that executes when a specific event takes place 2) A code segment similar to the following will be created automatically
29
A message box (aka dialog box)
Displays a message
30
The .NET Framework provides a method named
MessageBox.Show()
31
C# can use it to pop up
A window and display a message
32
Placing it in the "myButton_Click" event handler can display the string in the message box when
The button is clicked
33
Label Controls displays
Text on a form and can be used to display unchanging text or program output
34
Commonly used properties are:
1) Text 2) Name 3) Font 4) BorderStyle 5) AutoSize 6) TextAlign
35
1) Text
Gets or sets the text associated with label control
36
2) Name
Gets or sets the name of label control
37
3) Font
Allows you to set the font, font style, and font size
38
4) BorderStyle
Allow you to display a border around the control's text
39
5) AutoSize
Controls the way they can be resized
40
6) TextAlign
Set the text alignments
41
Handling Text Alignments
1) The TextAlign property supports the following values 2) You can select them by clicking the down-arrow button of the TextAlign property
42
By adding the bold lines to a button's event handler, a Label control can display
Output of the application
43
Equal sign (=) is known as
Assignment operator
44
IntelliSense provides automatic code completion as you write
Programming statements
45
It provides an array of options that make language references
Easily accessible
46
PictureBox controls
Displays a graphic image on a form
47
Commonly used properties are:
1) Image 2) SizeMode 3) Visible
48
1) Image
Specifics the image that it will display
49
2) SizeMode
Specifies how the control's image is to be displayed
50
3) Visible
Determines whether the control is visible on the form at run time
51
Programmers need to carefully arrange the sequence of statements in order to
Generate the correct results
52
Incorrect arrangement of sequence can cause
Logic errors
53
Comment are brief note that are placed in
A program's source code to explain how parts of the program work
54
A line comment appears on one line in
A program
55
A block comment can
Occupy multiple consecutive lines in a program
56
Programmer frequently use blank lines and identation in their codes
To make the code more human readable
57
Dealing with Syntax Errors
Code editor examines each statement as you type it and report any syntax error that are found
58
If syntax error is found, it is underlined with
A jagged line
59
If syntax error exists and you attempt to
Compile and execute, you will see the following.