Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
280
When to use Infragistic Controls vs Inbox?
posted

Hi -

I'm a new WinClient / WinForms controls user looking for some advice from the experienced/wise ones here! Two questions I need some guidance on:

1. What's the rule of thumb when trying to decide on whether to use the inbox controls or Infragistics controls in cases that aren't black and white like the grid? For example the textbox, groupbox, label, checkbox etc. My thinking is this: use the inbox controls where possible and use the Infragistics controls ONLY when the inbox ones don't suffice? Or is it better to just use ALL the Infragistics controls thinking this might be a better way to stay with controls that will be sure to get enhancements to them down the road vs the inbox?

2. The infamous GDI issue. Seems like it might be better for consistency and performance to use GDI rendering on all controls? And if so, is there a way to set the default TextRenderingMode to GDI for all controls instead of Default for design-time besides manually doing it one-by-one? I know you can globally set it in code for runtime, but is there an installation flag that can be set somehow to avoid having to do it in code and manually in the designer? Seems like GDI is the MS recommended approach and on the forums too. No one seems to be too happy with GDI+. Thoughts?

TIA for your help!

Leigh

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi Leigh,

    leighkendall said:
    1. What's the rule of thumb when trying to decide on whether to use the inbox controls or Infragistics controls in cases that aren't black and white like the grid? For example the textbox, groupbox, label, checkbox etc. My thinking is this: use the inbox controls where possible and use the Infragistics controls ONLY when the inbox ones don't suffice? Or is it better to just use ALL the Infragistics controls thinking this might be a better way to stay with controls that will be sure to get enhancements to them down the road vs the inbox?

    It depends on the needs of your application, in my opinion. The Infragistics editor controls like UltraTextBox and UltraComboEditor give you lots of appearance options, the ability to add buttons and dropdowns, better auto-complete support, etc.

    Personally, I would use the Infragistics controls so that all of the controls in the application are consistent. But of course, I'm biased. :)

    leighkendall said:
    Seems like it might be better for consistency and performance to use GDI rendering on all controls?

    It depends on the control. For a label control, like UltraLabel, you are probably better off with GDI Plus, since the label doesn't need to go into edit mode and show any Windows controls. For a TextBox / UltraTextEditor, you may get some text shifting in GDI+ when the control enters edit mode because it will be switching from GDI+ to GDI. There are a couple of ways around this. You could set AlwaysInEditMode to true, for example. This will disable the ability to use gradients or hatch appearance styles, but those are not used all that often, anyway. And you will still get all the other benefits of the control like editor buttons.

    leighkendall said:
    And if so, is there a way to set the default TextRenderingMode to GDI for all controls instead of Default for design-time besides manually doing it one-by-one? I know you can globally set it in code for runtime, but is there an installation flag that can be set somehow to avoid having to do it in code and manually in the designer?

    There's no way to do this at design-time, because there is no object to set a property on. You have to set it at run-time on the static property:

    DrawUtility.UseGDIPlusTextRendering = false;

    leighkendall said:
    Seems like GDI is the MS recommended approach and on the forums too. No one seems to be too happy with GDI+. Thoughts?

    There are a number of problems with GDI+ when it comes to rendering text. The spacing between characters changes depending on the text, and it is not possible to accurately measure text using GDI+.

    GDI does not have these issues, but the down side of GDI in DotNet is that it is slower. So if you are using a lot of text on the screen, like in a WinGrid with a large screen area and lots of columns, then using GDI could become a performance concern.

    But if you and your users are running on relatively fast machines, or if you are not displaying a huge amount of text, using GDI is probably the way to go.

Reply Children