Hi, i was adding some controls on the main form of my application and on next build I get badly rendered strings on all Infragistics controls, only on runtime: ad design time they are properly rendered. Can somebody tell me where could be the cause and how to solve it?
Thanks
Alessandro
Ok! I think I found an example that reproduces the behavior. My application has a splash screen and it seems that this form causes the font to be badly rendered. The strange thing is that in the past the same splash has never caused troubles. The SplashForm is derived fro a ShadowForm:
public class ShadowForm : Form { // class style that adds a shadow to the form private const int CS_DROPSHADOW = 0x00020000;
public ShadowForm() { }
protected override CreateParams CreateParams { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] get { CreateParams parameters = base.CreateParams; if (DropShadowSupported) { parameters.ClassStyle = (parameters.ClassStyle | CS_DROPSHADOW); } return parameters; } } /// <summary> /// Gets if drop shadow is supported by the OS. /// </summary> public static bool DropShadowSupported { get { return IsWindowsXPOrAbove; } } /// <summary> /// Gets if OS is Windows XP or above. /// </summary> public static bool IsWindowsXPOrAbove { get { OperatingSystem system = Environment.OSVersion; bool runningNT = system.Platform == PlatformID.Win32NT; return runningNT && system.Version.CompareTo(new Version(5, 1, 0, 0)) >= 0; } } }
The call from the program.cs is:
static class Program { //private static Form _splash = null; private static Splash _splash = null; private static Form1 _mainform = null; private static ApplicationContext _context = null; /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); _mainform = new Form1(); _context = new ApplicationContext(); Application.Idle += new EventHandler(OnApplicationIdle); //_splash = new Form(); _splash = new Splash(); _splash.Show(); Application.Run(_context); } static void OnApplicationIdle(object sender, EventArgs e) { if (_context.MainForm == null) { Application.Idle -= OnApplicationIdle; _mainform.PreLoad(); _splash.Close(); _splash.Dispose(); _splash = null; _context.MainForm = _mainform; _context.MainForm.Show(); } } }
If I use a standard form the strings on the menu of the UltraToolbarsManager are well rendered, if I use a Splash form the font they are ugly. If it helps I can e-mail you the VS2008 solution.
Hi, actually I'm trying to isolate the code that could cause this behavior. The MainForm is too huge.
I'm using NetAdvantage 2010.1 with Visual Studio 2008, framework 3.5 on a Windows 7 64bit PC.
As soon I reproduce the issue I'll post the code. What is really funny is that at design time it renders well, but at runtime it looks ugly!
Hello Alessandro,
Can you post small sample or code snipped to reproduce this behavior and investigate the cause? Also can you give us a little more details about your version and environment?
Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Ok... this is how text on the UltraToolbarsManager is rendered at design time:
and this is how it looks at runtime:
(the text is loaded on the constructor to load localized string)....
P.S. - in the text box, the rendering is OK when it has focus, when it looses the focus its badly rendered...