.NET - Windows Controls
65.
How can you adjust the height of a combo box drop-down list?
You can control the height of a combo box drop-down list by setting the MaxDropDownItems property of the combo box. The MaxDropDownItems property sets the maximum number of entries that will be displayed by the drop-down list.
66.
How can you enforce a text box to display characters in uppercase?
The TextBox class contains the CharacterCasing property, which is used to specify the case of the content for a text box. This property accepts a value from the CharacterCasing enumeration of .NET Framework. The members specified in the CharacterCasing enumeration are Lower, Upper, and Normal. You can select any one of these enumerations as a value for the CharacterCasing property of a specified text box, as shown in the following code snippet:
textBox1.CharacterCasing = CharacterCasing.Upper;
textBox1.CharacterCasing = CharacterCasing.Upper;
67.
Is it possible to associate a control with more than one ContextMenu?
No, we cannot associate a control with more than one ContextMenu.
68.
How can you check/uncheck all items in the CheckedListBox control in .NET 4.0?
To check all items in .NET, you can use the following code snippet:
Code for VB:
Code for C#:
Code for VB:
Dim i as Integer
For i = 0 To myCheckedListBox.Items.Count - 1
myCheckedListBox.SetItemChecked(i, True)
Next
Code for C#:
for( int i = 0; i < myCheckedListBox.Items.Count; i++ )
{
myCheckedListBox.SetItemChecked(i, true);
}
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers