You are on page 1of 3

1. Which shortcut key is used to access the Properties window of a form at design time?

F12
F8
F4
F1
2 .Consider the following statements and choose the appropriate option.<br>
Statement A: The UserControl class can be used to combine the functionality of different
controls into one reusable unit.<br> Statement B: The UserControl class presents
multiple interfaces, which contain members inherited from the control classes.

Statement A is true, and Statement B is false.


Statement A is false, and Statement B is true.
Both statements are true.
Both statements are false.
3. You want to create a custom control named CustomControl1, which is inherited from the
standard Button control. Which code snippet will you use to declare the class of the custom
control?

public control CustomControl1: System.Forms.Button


public class CustomControl1: System.Forms.Button
public control CustomControl1: System.Windows.Forms.Button
public class CustomControl1: System.Windows.Forms.Button
4Which property is used to display a check mark on a menu command by default?

CheckOnClick
Checked
CheckedState
DisplayStyle
5 Consider the following statements and choose the appropriate option.

Statement A: The CrystalReportViewer control can export a report to formats such as


Portable Document Format, Microsoft Office Access, and Microsoft Office Excel.
Statement B: The ReportViewer control can display compiled reports from the local file
system or render the output from a remote report server.

Statement A is true, and Statement B is false.


Statement A is false, and Statement B is true.
Both statements are true.
Both statements are false.
6You have created a form for accepting invoice details. When a user points to the Add
button on the form, a tool tip displaying the text "Adds invoice details to the database"
should be displayed. List the steps to perform this task.

1. Drag the ToolTip control on to the form and specify its name as ToolTip1.
2. Set the ToolTipText property of the ToolTip control to Adds invoice details to the
database.

1. Drag the ToolTip control on to the form and specify its name as ToolTip1.
2. Set the 'ToolTip on ToolTip1' property of the Add button to Adds invoice details to the
database.

1. Drag the ToolTip control on to the form and specify its name as ToolTip1.
2. Set the SetToolTip property of the Add button to Adds invoice details to the
database.

1. Drag the ToolTip control to the form and specify its name as ToolTip1.
2. Set the ToolTipText property of the Add button to Adds invoice details to the
database.
7 You need to create an application that allows the user to load an image file to the
PictureBox control pictureBox1, which is available on the form. You have created a Button
control named button1, which opens the OpenFileDialog called openFileDialog1. This
OpenFileDialog allows the user to select the image file to be opened. The code in the click
event of button1 is given below:

openFileDialog1.InitialDirectory = "c:\\";
openFileDialog1.Filter = "JPG Image Files(*.JPG)|*.JPG|BMP Image Files(*.BMP)|*.BMP|GIF
Image Files(*.GIF)|*.GIF";
openFileDialog1.FilterIndex = 1;
openFileDialog1.RestoreDirectory = true;
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image =openFileDialog1.FileName;
}

However, an error is generated on executing this code. Analyze the error and suggest a
possible solution.

The value of the InitialDirectory property of openFileDialog1 is invalid. Correct it by


setting it as "C:\".
The value of the FilterIndex property of openFileDialog1 is invalid. Correct it by setting
it as 3.
The value of the Filter property of openFileDialog1 is invalid. Correct it by removing all
the () brackets.
The Image property of pictureBox1 is invalid. Correct it by replacing it with the
ImageLocation property of pictureBox1.
8 You have created an MDI application. The application opens a child form when the user
clicks on the New button on the menu bar. The click event of the New button has the
following code:

Form childForm= new Form1();


childForm.MdiParent = this;
childForm.Text = "Child window opened"

However, on executing the code, the user is not able to see the child form. What could be
the possible cause of error?

The user needs to set the childForm visible property to true.


The user needs to call the BringToFront method of childForm.
The user needs to call the Show method of childForm.
The user needs to call the Activate method of childForm.
9 Consider the following statements and choose the appropriate option.
Statement A: The AllowFullOpen property of the ColorDialog component specifies whether
the controls used to create custom colors are available.
Statement B: The FullOpen property of the ColorDialog component specifies whether the
user can use the dialog box to define custom colors.

Statement A is true, and Statement B is false.


Statement A is false, and Statement B is true.
Both statements are true.
Both statements are false.
10One of the major benefits of a ClickOnce application is the ability to automatically check
for application updates. You have chosen the option 'After the application starts' in the
Application Updates dialog box. Now, the application will ___________.

Check for updates before the application starts.


Check for updates in the background.
Check for updates from a specific update location.
Not check for any updates after the application has started.

You might also like