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
Q

C# code is organized as

A

Methods, which are contained inside classes, which are contained inside namespaces

26
Q

GUI applications are event-driven which means they interact with

A

Users

27
Q

A event is a user’s action such as

A

Mouse clicking, key pressing, etc.

28
Q

Double clicking a control, such as Button, will link the control to a default Event Handler

A

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
Q

A message box (aka dialog box)

A

Displays a message

30
Q

The .NET Framework provides a method named

A

MessageBox.Show()

31
Q

C# can use it to pop up

A

A window and display a message

32
Q

Placing it in the “myButton_Click” event handler can display the string in the message box when

A

The button is clicked

33
Q

Label Controls displays

A

Text on a form and can be used to display unchanging text or program output

34
Q

Commonly used properties are:

A

1) Text
2) Name
3) Font
4) BorderStyle
5) AutoSize
6) TextAlign

35
Q

1) Text

A

Gets or sets the text associated with label control

36
Q

2) Name

A

Gets or sets the name of label control

37
Q

3) Font

A

Allows you to set the font, font style, and font size

38
Q

4) BorderStyle

A

Allow you to display a border around the control’s text

39
Q

5) AutoSize

A

Controls the way they can be resized

40
Q

6) TextAlign

A

Set the text alignments

41
Q

Handling Text Alignments

A

1) The TextAlign property supports the following values
2) You can select them by clicking the down-arrow button of the TextAlign property

42
Q

By adding the bold lines to a button’s event handler, a Label control can display

A

Output of the application

43
Q

Equal sign (=) is known as

A

Assignment operator

44
Q

IntelliSense provides automatic code completion as you write

A

Programming statements

45
Q

It provides an array of options that make language references

A

Easily accessible

46
Q

PictureBox controls

A

Displays a graphic image on a form

47
Q

Commonly used properties are:

A

1) Image
2) SizeMode
3) Visible

48
Q

1) Image

A

Specifics the image that it will display

49
Q

2) SizeMode

A

Specifies how the control’s image is to be displayed

50
Q

3) Visible

A

Determines whether the control is visible on the form at run time

51
Q

Programmers need to carefully arrange the sequence of statements in order to

A

Generate the correct results

52
Q

Incorrect arrangement of sequence can cause

A

Logic errors

53
Q

Comment are brief note that are placed in

A

A program’s source code to explain how parts of the program work

54
Q

A line comment appears on one line in

A

A program

55
Q

A block comment can

A

Occupy multiple consecutive lines in a program

56
Q

Programmer frequently use blank lines and identation in their codes

A

To make the code more human readable

57
Q

Dealing with Syntax Errors

A

Code editor examines each statement as you type it and report any syntax error that are found

58
Q

If syntax error is found, it is underlined with

A

A jagged line

59
Q

If syntax error exists and you attempt to

A

Compile and execute, you will see the following.