What property is being used to change the background color for every element?
What property is being used to set the element’s variable name?
List out 5 values for image size mode
List out 2 values for the Visible property
How to change the element text shown at the UI?
List out 9 properties for Text Alignment
What property is set to ensure that the elements doesn’t relocate when the windows expand or shrink?
What property is being used to change the text color?
What property in TextBox is used to hide the letters input?
List out 5 types of events
How to show the dialog box the shows the message when a button is pressed?
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(“Hello”);
}
What property allows changing the element’s text font, font style, and font size?
List out 3 values that can be set in the BorderStyle
Which properties can be used to enable auto size method?
What is an assignment operator?
How to assign the text from label1 to another text Hello?
How to change the label1 background color to another color ( blue ) after a button is pressed?
private void button1_Click(object sender, EventArgs e)
{
label1.BackColor = Color.Blue ;
}
this.BackColor = Color.Red;
// Will change the background color for the current form
this inside a class means the current instance of the class
How to use concatenation?
“Welcome” + “to C#”
1 + 1 = 2
“1” + “1” = 11
List out how to write comment on
1. Single Line Comment
2. Multiline Comment
What is identation being used for?
How to close the current application form when a button is clicked?
private void exitButton_Click(object sender, EventArgs e)
{
// Close the form.
this.Close();
}
List out 3 types of error
How to declare variable car to store string Perodua?
How to declare variable age with current year ( DateTime ) minus birth year ( txtBornYear ) ?
int birthYear = int.Parse(txtBornYear.Text);
static int currentYear = DateTime.Now.Year;
int age = currentYear - birthYear ;
Improvement with Error Checking
int birthYear;
if (int.TryParse(txtBornYear.Text, out birthYear))
{
int currentYear = DateTime.Now.Year;
int age = currentYear - birthYear;
MessageBox.Show(“You are “ + age + “ years old.”);
}
else
{
MessageBox.Show(“Please enter a valid year.”);
}