Test Your Knowledge

Windows Forms Quiz

Answer all questions to test your understanding

1 What is the entry point of a Windows Forms application?
2 Which file is auto-generated by the Windows Forms designer?
3 What method in Program.cs starts the Windows Forms application?
4 What is the purpose of the [STAThread] attribute in Program.cs?
5 What happens when you press F5 in Visual Studio with a WinForms project?
6 Which control is used for single-line text input?
7 What naming prefix is recommended for a TextBox control?
8 What does the Anchor property do in Windows Forms?
9 Which property makes a control fill an entire form or panel?
10 How do you read the text from a TextBox in code?
11 What is the most common way to wire up a Button click event?
12 Which event fires when a form first loads?
13 What does the FormClosing event allow you to do?
14 Which event fires when text in a TextBox changes?
15 What is the signature of a typical event handler in WinForms?
16 Which control is used to create a menu bar in Windows Forms?
17 What method displays a MessageBox with an OK button?
18 What does OpenFileDialog.ShowDialog() return?
19 How do you access the selected file from OpenFileDialog?
20 What does setting DialogResult = OK do in a custom form?
21 What control is used to display tabular data in Windows Forms?
22 How do you bind a DataGridView to a DataTable?
23 What property of a ComboBox controls what the user sees?
24 What property of a ComboBox controls the underlying value?
25 What is the purpose of BindingSource in Windows Forms?
26 How do you open a second form without making it modal?
27 How do you open a second form modally?
28 How do you get data back from a child form?
29 What does the using statement do when creating a modal form?
30 What property makes a form an MDI container?
31 Which method is used to execute INSERT, UPDATE, or DELETE commands?
32 What event is used to refresh the DataGridView after saving?
33 How do you check if a user confirmed a delete operation?
34 What property tracks the currently selected row in a DataGridView?
35 How do you clear a TextBox in Windows Forms?