Hallo,
which is the simplest way to switch On/Off UseAppStyling and UseOSThemes for all controls in the application at runtime?
We need three states:- Standard: UseAppStyling is off, UseOSThemes is off.- System: UseAppStyling is off, UseOSThemes is on.- Styles: UseAppStyling is on, UseOSThemes is off.
All of our controls have the default properties in the WindowsForms Designer:- UseAppStyling = true- UseOSThemes = DefaultableBoolean.Default
Hi,
jabor said:- Styles: UseAppStyling is on, UseOSThemes is off.
This case is easy enough to handle, since the isl will turn off themes by default.
jabor said:- Standard: UseAppStyling is off, UseOSThemes is off.- System: UseAppStyling is off, UseOSThemes is on.
To turn off the isl, you would do this:
StyleManager.Reset();
I don't think there is any static property to turn off themes on all of the controls. But what you could do is just create a new Style Library in AppStylist. When you do this, AppStylist will prompt you if you want to turn off themes and you click Yes. Then you just save that style library which does nothing but turn off themes and load that when you want themes off and no other styling applied.
thank you for the response Mike.
Mike Saltzman said: - Styles: UseAppStyling is on, UseOSThemes is off. This case is easy enough to handle, since the isl will turn off themes by default.
Does your Style "Office2007Blue" turn off the themes?We are using that style and have problem with some BackColor.We have nowhere altered the BackColor manually. The grey controls are UltraLabels and UltraCheckEditors and are embedded in a UserControl. This picture shows the dialog on Windows Server 2003. On Windows XP are the grey areas yellow.
Mike Saltzman said:- Standard: UseAppStyling is off, UseOSThemes is off.- System: UseAppStyling is off, UseOSThemes is on. To turn off the isl, you would do this: StyleManager.Reset();
To turn off the isl, you would do this: StyleManager.Reset();
Yes, that turns off the isl, but not UseOSThemes.
Mike Saltzman said:I don't think there is any static property to turn off themes on all of the controls. But what you could do is just create a new Style Library in AppStylist. When you do this, AppStylist will prompt you if you want to turn off themes and you click Yes. Then you just save that style library which does nothing but turn off themes and load that when you want themes off and no other styling applied.
I have already tried to make two empty styles. In the first style I have choosed the option "turn off themes", in the second the option "use themes". I do not see any differences.
jabor said:Does your Style "Office2007Blue" turn off the themes?
Yes, it does. I don't think what you are seeing here has anything to do with themes, it looks like the isl file is simply not making those controls transparent. I think this might have been fixed recently. What version of the controls are you using? Do you have the latest service release?
How to get the latest service release - Infragistics Community
Worst case, you could open up the isl and go to the UIRole for those two controls and set the BackColor to transparent yourself.
jabor said:I have already tried to make two empty styles. In the first style I have choosed the option "turn off themes", in the second the option "use themes". I do not see any differences.
If you are not seeing any difference, then perhaps your application operating system does not support themes. Or maybe you are just not looking at the right controls. "Themes" in this case refers to the operating system themes. Not every control uses themes. Take a look at an UltraButton control (with the default settings) and switch UseOsThemes on and off and that will give you a very clear and obvious difference.
Mike Saltzman said:If you are not seeing any difference, then perhaps your application operating system does not support themes.
Mike Saltzman said:Worst case, you could open up the isl and go to the UIRole for those two controls and set the BackColor to transparent yourself.
Mike Saltzman said:Do you have the latest service release?
jabor said:Worst case, you could open up the isl and go to the UIRole for those two controls and set the BackColor to transparent yourself. If I do that, than nothing is blue, except the buttons and captions.[/quote] I think you must be setting a Transparent BackColor on the wrong UIRole, then. I was only suggesting that you make the two controls that are having a problem transparent. If this is affecting other controls, then you must be using a UIRole that affects more than just those two controls. jabor said:Do you have the latest service release? We are using the version 2010.1. We will dowload 2010.3 and test it.[/quote] I was not suggesting that you need to upgrade to a completely new version of NetAdvantage, just that you make sure you have the latest service release for the version you already have.
I think you must be setting a Transparent BackColor on the wrong UIRole, then. I was only suggesting that you make the two controls that are having a problem transparent. If this is affecting other controls, then you must be using a UIRole that affects more than just those two controls.
jabor said:Do you have the latest service release? We are using the version 2010.1. We will dowload 2010.3 and test it.[/quote] I was not suggesting that you need to upgrade to a completely new version of NetAdvantage, just that you make sure you have the latest service release for the version you already have.
Do you have the latest service release?
I was not suggesting that you need to upgrade to a completely new version of NetAdvantage, just that you make sure you have the latest service release for the version you already have.
jabor said:The controls seems to be in the GroupBox, but they are only on the top of it.
That's the problem, then. This will not work. A Transparent control will never draw controls that are behind it, only controls that contain it. That's just the way transparency works in DotNet, there's nothing we can do about that.
So in a case like this, you would have to make those controls the same color as the GroupBox - transparency will not work.
Or you could put the controls inside the GroupBox.
Hi Mike,
Mike Saltzman said:I think you must be setting a Transparent BackColor on the wrong UIRole, then. I was only suggesting that you make the two controls that are having a problem transparent. If this is affecting other controls, then you must be using a UIRole that affects more than just those two controls.
I took the only one shared UIRole (ControlArea) of the two control. OK, I could take two more special UIRoles, but they does not help, the controls remain grey.
I think we have an other reason: We have a base dialog with the two GroupBoxes and some Buttons on it. Than we have several derivied dialoges (one of them you see above) with the Labels, Editors and CheckBoxes on it. The controls seems to be in the GroupBox, but they are only on the top of it. I think the grey Labels and CheckBoxes has already a transparent BackColor, but they show the color of the dialog and not of the GroupBox. My problem is, that I can not change the BackColor of the dialog. The inbox WindowsForms.Form and UserControl has no UIRoles at all, only the Property BackColor. I have changed it in the .isl file, but it has no effect in the application (that's why I have thougt on the themes).
I will try the service release, you suggested.