Hi programmers!)
I'm developing a custom component and I can't understand - how to make a property which can show a window with options like "font" property for button, for example ?
please tell how to do this from where i can find it out.

big thanks in advance))

Recommended Answers

All 13 Replies

may be the question isn't clear....if so - tell me)

What tools are you using? Are you using WPF and XAML? And yes, could you please explain a little bit more?

commented: ++++++ +3

What tools are you using? Are you using WPF and XAML? And yes, could you please explain a little bit more?

I use only VS express edition (as I think - in reality the situation can be different...)))
WPF and XAML - no use (as I think too...)

And yes, could you please explain a little bit more?

component "Button" has a property "Font" which value you can change after click on small button with 3 points- (...) - after click on it VS will show additional window with font options.....
is there a way to add a property to custom component which can be changed like "Font" for "Button"?

Ok, I think I understand what you are asking and my answer is yes. I am going to assume you created a windows forms project, and the properties that are available are what you get to work with as a default. You would be able to create a new class that inherits from a control, say "Button", and add additional properties. So your "Button" already has a "Font" property, but if you derived a new class from "Button", you could add any kind of property you want. Do you know what inheritance is?

Do you know what inheritance is?

yes of course)

LevyDee , I don't need font property for my component - I need additional window in which user can for example choose the color of brush - yes, certainly he can do it in standart property window (View->Properties window - in VS) , but I want exactly additional window))) (like "Font" can show after double click on the value of font property)

I suspect what you want are property attributes that affect how the property is displayed in a property grid control. If your class is more than just a design-time component, you can also make use of the PropertyGrid control directly in your own applications.

commented: +++ +3

Narue , you always help me!) thank you)

mmm......as I understand I should use EditorAttribute, don't I? Narue ?

yes. should ))

How can I add the "Brush" property to select the type of brush?

or may be you want a smart Tage ..
like this the one in attachement

or may be you want a smart Tage ..
like this the one in attachement

sandeepparekh9 I've figured out what was wrong) thank you, friend)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.