PrepAway - Latest Free Exam Questions & Answers

Author: admin

Which code segment should you use?

You are creating a custom Windows Forms control. On the background of the control, an ellipse completely filled with a colored gradient is drawn. The bounds for the ellipse are equal to the bounds for the control. The control must correctly repaint itself in all situations. You need to include the drawing of the ellipse in the OnPaint event handler for the custom control. Which code segment should you use?

Which code segment should you use?

You are customizing a Windows Form. The form includes a menu that has several ToolStripMenuItem controls. An event handler is configured to handle the Click event for all ToolStripMenuItem controls. The event handler has the following signature. private void menu_Click(object sender, EventArgs e) The form class includes a method that has the following signature.
private void LogClick(string ctlName)
You need to add code so that when a user clicks a ToolStripMenuItem control, the menu_Click method calls the LogClick method. The LogClick method must be called with the ctlName parameter set to the menu text in the ToolStripMenuItem control.
Which code segment should you use?

What action should you take?

You have received instructions to make sure that the PictureBox control’s properties cannot be changed with a logo that you have added to the PictureBox in the designer of the form base. Before the time you have added a form to the Microsoft Windows Forms Control Library project and add a PictureBox control to the form.
The form is presenting Domain.com’s logo.
What action should you take?

Which code segment should you use to format the columns at run time?

You are creating a Windows Form. You add a TableLayoutPanel control named pnlLayout to the form. You set the properties of pnlLayout so that it will resize with the form. You need to create a three-column layout that has fixed left and right columns. The fixed columns must each remain 50 pixels wide when the form is resized. The middle column must fill the remainder of the form width when the form is resized. You add the three columns in the designer. Which code segment should you use to format the columns at run time?

Which two actions should you perform?

You are creating a Windows Form application. You add a new form named ClientNameDialog that will be used as a custom dialog box.
The form contains custom control name btnOk, another button control named btnCancel, and a text box control named txtName.
You need to notify the application’s startup form which button was clicked when the dialog box is closed.
Which two actions should you perform? (Each correct answer presents part of the solution.
Choose two.)