Detect when FileNameEditoris shown

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a file path (i.e., String) property that uses a
System.Windows.Forms.Design.FileNameEditor as its
System.ComponentModel.Editor. This property is exposed by a PropertyGrid.
What I need to do is to detect when the Open File dialog is shown (when the
user clicks the ellipsis for that property) and when the dialog is closed so
that I can suspend certain events while the dialog is being displayed. Is
this possible?
 
Hi

I think you may need to inherits the FileNameEditor class and override the
FileNameEditor.EditValue Method.
Because when we click in the propertygrid to modify the property, we will
invoke the File Dialog in the EditValue method of FileNameEditor class.

You may try to get the open and close as the form similar with below.
e.g. pcode
FileNameEditor.EditValue
{
BeginOpenDialog;
base.EditValue(...);
EndOpenDialog;
}

Hope this helps!

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top