We are using AppStylist in our application. At runtime, creating controls dynamically, I am trying to change the font for the UltraLabel like this.
this.Font = new System.Drawing.Font("Ariel", 8.5F, FontStyle.Regular);
This works as expected on Windows XP. It doesn't work on Windows Vista. It works for Bold, Underline and Italics but it does not change the Font on the Vista Machine. The fonts used are installed on both machines.
It's hard to guess without knowing what your application style is doing, but the fact that it is specific to the operating system indicates it may be related to Themes.
Does your isl file turn off themes? If not, you may want to look into doing that. When you create a new isl file, you are prompted to turn off themes, because otherwise, some appearances will not work since the theming will override them.
You may also want to check the UseOsThemes property on the label.
thanks mike
I turned off the UseOsThemes in my label, but it didn't do the trick. We copied an existing Infragistics stylesheet to customize it. I don't know if the themes are turned off by default.
I created a simple Windows Application. I have a UltraLabel, UltraTextEditor and a regular Windows Label on the form. i have a button with click event. Here's the snippet of the code-behind
public partial class Form1 : Form { public Form1() { InitializeComponent(); Infragistics.Win.AppStyling.StyleManager.Load("customStyleSheet.isl"); } private void ultraButton1_Click(object sender, EventArgs e) { this.label1.Font = new Font("Lucida Calligraphy", 8.5F, FontStyle.Regular); this.ultraLabel1.Font = new Font("Lucida Calligraphy", 8.5F, FontStyle.Regular); this.ultraTextEditor1.Font = new Font("Lucida Calligraphy", 8.5F, FontStyle.Regular); } }
on XP machine this works. On Vista machine the windows label works as expected, but the Infragistics controls retain the original font.
Can I assume that if you do not load the isl file, it works on Vista as well as XP?
Can you post a small sample project (including your isl file) here so I can test this out?