Consider a form with a TextBox
and a Button
. When you click that button you should get the Font
properties dialog at run-time.
During designer you can click the button off to the right of the property in the PropertyGrid
and get the editor window to manipulate the Font for this TextBox
. During run-time, if you add a PropertyGrid
to the form and point it to the TextBox
you can also get the editor window.
How can I get this editor window at run-time through say, a button click without having a PropertyGrid
on the form?
Though I've gotten the PropertyDescriptor
and the UITypeEditor
from this descriptor, I don't know what to call to get the instances of ITypeDescriptorContext
and IServiceProvider
when calling UITypeEditor.EditValue
.
EDIT - Since I asked this problem of a control that has an easy solution, I've asked another question related to this topic: How to open the properties dialog for a Complex Property without a PropertyGrid at runtime