Hi all,
I try to use UltraDropDownButton with OsThemes, but it appears to take different styles than the other controls.
I have prepared a simple WinForms solution with UltraDropDownButton, UltraButton and a TextBox (to put a focus on something). Both Ultra- controls have UseOsThemes set to true.
In runtime, an UltraButton is displayed correctly, while an UltraDropDownButton is transparent (there is no backcolor, borders, etc). All UltraDropDownButton colors are displayed when a mouse is over the control.
How to make an UltraDropDownButton look like an UltraButton? Is there a way to use OsThemes for UltraDropDownButton? My os theme is Windows 7 Basic.
Hi,
I think the model for the UltraDropDown button was a Toolbar button, as opposed to a regular button you see on a form. So it draws using the Toolbar button themes.
I don't think there is anything in the Windows theming API to draw a segmented button that looks like a regular themed button.
Are you using UltraDropDown button segmented? Or just as a single button that drops down a control when clicked?
If it's just a single button, then maybe you could just use an UltraButton and make it look like a DropDown and then handle the click event and drop down the control using the PopupControlContainer component.
If you need two segments, then I think your best bet might be to use a DrawFilter and handle the drawing yourself. But like I said, I don't think there is any way to drag the segments so that they look like a regular themed button. So the best you could probably do is draw it like two buttons next to each other. In other words, you would lose the straight edge between the two buttons - the corners would be rounded.
Hi Mike, I've utilized the DropdownButtonDrawFilter.DrawElement() filter, as posted elsewhere. On Windows 8.x it restores the consistent button look and feel of the control with one hitch. The requested back color is altered as if there is some automatic transparency applied to it. I've even gone so far as to compute for each RGB value, the fractional difference between what I've requested and the resulting color (as reported by a color eyedropper) and tailored my back color specification accordingly, but the resulting Red specification exceeds 255.
Do you have any suggestions for preserving the intended back color?
Thanks, rand
Hi Rand,
Your post is a bit vague. Without knowing what you are doing and what you are trying to do, I'm afraid I can't guess why your button is transparent. Can you provide more information?
If you are using the DrawElement phase, then you are handling all of the drawing for all phases for the entire element, so you are responsible for drawing the BackColor, ForeColor, etc. If you only want to change the image or something, then you should be handling BeforeDrawImage or a more specific phase.