Chapter 1 : Introduction to Visual Programming Flashcards
What components respond to actions from users such as mouse clicks, pressing keys on keyboards or placing the mouse cursor over user interface objects
- Graphical User Interface ( GUI )
What are the actions known as ? ( mouse click, pressing key on keyboards )
- Event
What does a Visual C# applications project start with? ( 3 )
- Designer
- Toolbox
- Property Window
- An empty form is generated and its name is Form1
What is the form basic width and height
- 300 pixel each
What does the property window do?
- Change the settings for the appearance and other characteristics of a GUI object
What will be displayed in the column’s property list? ( 2 )
- Left Column
- Property’s Name
- Right Column
- Property’s Value
What is controls name
- Identifiers of the controls
List out the rules for naming controls
- The first character must be letter ( lower , uppercase doesn’t matter ) or an underscore
- All other characters can be alphanumerical characters or underscores
- The name cannot contain spaces
- Example
showDayButton
DisplayTotal
_ScoreLabel
List out 3 ways for how C# code is primarily organized?
- Namespace
- A container that holds classes
- Class
- A container that holds methods
- Method
- Group of one or more programming statements that perform some operations
What is a file that containes program code is called?
- Source Code File
What source code file that is automatically created when creating a new project?
- Program.cs
- Contains the application’s start-up code to be executed when the application runs
- Form1.cs
- Contains code that is associated with the Form1 form
- Can open through Solution Explorer
How does C# code is organized?
- As methods
What does a program waits in event-driven programming?
- An event to occur after executed
- Determine how controls ( button, textbox ) respond to events that are set for the respective control
Who controls the program response in event-driven programming?
- User
List out 3 ways that the event can occur
- The user doing something ( Click a button )
- Something happening within th ecomputer ( System Shutdown )
- Something happening within the program ( Program Crash )
List out 5 types of events
- Activate Events
- User selects item on screen
- Changed Events
- Control property modified
- Focus Events
- Control gets or loses focus
- Key Events
- User interacts with keyboard
- Mouse Events
- User interacts using mouse
What is an event handler? ( 2 )
- Method that executes when a specific takes place
- Code segment similar to the following will be created automatically
private void myButton_Click(object sender, EventArgs e)
{
}
What does a message box does?
- Displays a message
What is the code for showing a message box?
- MessageBox.Show(“Hello”)
- Placing it inside the event handler ( button ) can display the string in the message box when the button is clicked
What does a label do?
- Display text on a form and can be used to display unchanging text or program output
List out 6 commonly used properties
- Text ( Displayed text )
- Name ( Method name )
- Font
- BorderStyle
- AutoSize
- TextAlign
List out 9 values that the TextAlign property supports
- TopLeft
- TopCenter
- TopRight
- MiddleLeft
- MiddleCenter
- MiddleRight
- BottomLeft
- BottomCenter
- BottomRight
- Select by clicking the dropdown button in TextAlign property
How to change a property ( Change label text from “Hi” to “Hello” ) ?
- Use Assignment Operator ( = )
label1.Text = “Hello”;
- Details
1. Control name followed by a dot
2. Property to be modified ( left side , .Text )
3. Value to be assigned ( Right side , = “Hello” )
How to change the color properties?
- Using class name Color followed by a dot
label1.BackColor = Color.blue