0

Hi,
In my DialogResult form which pops out when the user want to delete something ,the close button is shown disabled(cant click on it).How can i enable it?
thnx in advance

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by Renukavani
0

If its that dialog box s usercontrol then u can do this way,

Create instance for Usercontrol, using that instance u can get the close button ID. based on that ID assign whatever property u want to assign.

0

Can you specify what form you are using? DialogResult is a property of a form which can be returned if it is shown modally (ShowDialog).
Are you using a form you have designed, a MessageBox or a 3rd party control? If you have a 3rd party control then it will a bit harder for us to know what the problem is.

0

Hi

Thanks for the reply.I am using a MessageBox.Do you know how to enable the disabled Close button?

0

When you say it is "shown disabled" do you mean that is is visibly disabled (eg greyed out) or that it is there but clicking on it has no effect?
If you specify a button set for the messagebox which does not include Cancel then the close button will be clickable but nothing will happen. This is because a Yes/No box is intended to return a yes or a no, the Close button is equivalent to clicking Cancel.

Try MessageBox.Show("test", "test", MessageBoxButtons.YesNoCancel); and let me know if the same problem occurs.

0

Close button is disabled for these are options

1.MessageBoxButtons.AbortRetryIgnore
2.MessageBoxButtons.YesNo

Edited by Renukavani: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.