AcceptButton like property
Something similar to Form's AcceptButton property that list all buttons available on container form.
Any hint?
TIA
Corrado
TIA
Corrado
Make your property of the type of the control you want to be listed on your propertygrid. On your case, you can do it this way:
private TextBox _myTextBox = null; [ DefaultValue(null) ] The attribute above the property indicates that you want your property to able to remove (or accept null) value.
public TextBox MyTextBox
{
get { return _myTextBox; }
set { _myTextBox = value; }
}
-chris
Thanks, but is not what I'm looking form.
I'm not trying to expose a Textbox from my control, i want my control to list all textboxes available on the same form where my control sites.
So i presume I have to use Parent property and enumerate all textboxes in parent.Controls, but don't know if this is the right choice.
FYI: Default value does not indicates what type your property accepts but just its default value and how it should be serialized...
Thanks, anyway
Corrado
Corrado Cavalli wrote:
FYI: Default value does not indicates what type your property accepts but just its default value and how it should be serialized...
Hi corrado,
Thanks for the correction. I actually want to say the same thing, but I find it difficult sometimes to speak in a foreign language like the language of this forum which is "english". I think I have to workout with my english more.
Thanks again.
-chris