My apologies in advance if this question is really simple:
Our WinForms applications uses a StyleSet called "Default" from a Style Library. This StyleSet includes styling for UltraButtons that is really simple: a gradient background, some hottracking styling, etc.
We now have a few buttons on some of our forms/user controls that require us to use images (e.g., Up and Down arrows as background images on UltraButtons).
I want to keep all the styling of the "Default" StyleSet except for the UltraButtons' background image.
Am I correct in understanding that I need to make a different StyleSet for each different background image I want to use? It seems like this would be a lot of work if you had, for example, 10 different background images you intended to use. If this is not the case, what am I missing? What do I need to do?.
Thanks,-Dave
Hi Dave,
AppStyling is generally used for styling a whole application in a general way. For styling an individual control and applying an image to it, you are probably better off doing that in the application itself and setting the ResolutionOrder on the ComponentRole for the button to ControlThenApplication so the control setting can override the AppStylist setting. Or maybe you should use the Image property of the button rather than the ImageBackground.
Of course, there are cases where you would want to do this with AppStylist. If you want to change to different sets of images to match different color schemes of different isl's, for example.
In that case, you could use separate StyleSets, but there is an easier way. What I would do is use a Resource. What you can do is create a Resource for each button in the isl. Then in the application, you can set the button.Appearance.StyleResourceName to the name of the Resource.
Thank you for your informative response; we will probably go the Resource route so that we can keep as much of the styling as possible contained within AppStylist/the isl.
Thanks again,Dave