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.)

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.)

A.
Use the ShowDialog method to display an instance of ClientNameDialog.

B.
Use the Show method and pass the current form as a
parameter to display an instance of ClientNameDialog.

C.
Using the DialogResult property of the dialog box instance, indicate which button the user clicks on ClientNameDialog.

D.
Using the AcceptButton property of the dialog box instance, indicate which button the user clicks on ClientNameDialog.



Leave a Reply 0

Your email address will not be published. Required fields are marked *