49. What are the three states set in the CheckState property of CheckBox?
Checked
Unchecked
Indeterminate
50. How can you display an icon at runtime on the StatusStrip control?
The following code snippet shows the code to display an icon at runtime on the StatusStrip control:
toolStripStatusLabel2.Image = Bitmap.FromFile(“D:\\Indiabix\\Images\\1.bmp”);
51. Can you add more than one item simultaneously in the ListBox control?
Yes, You can add more than one item simultaneously in the ListBox control by using the AddRange() method.
52. What is the difference between a MenuStrip control and a ContextMenuStrip control?
The difference between a MenuStrip control and a ContextMenuStrip control is that a MenuStrip control is associated with the Windows Form; whereas, a ContextMenuStrip control is associated with a control, which is added to the Windows Form.
53. What are the values that can be assigned to the DialogResult property of a Button control?
The DialogResult property of a Button control can be assigned a value from the DialogResult enumerations, which are as follows:
Abort-Returns Abort
Cancel-Returns Cancel
Ignore-Returns Ignore
No-Returns No
None-Nothing is returned from the dialog box
OK-Returns OK
Retry-Returns Retry
Yes-Returns Yes
54. Why do you require user-defined controls?
User-defined controls are particularly useful in situations where you need to enhance the functionality of an existing control.