• Enhancing your WinForms UI with HTML-like formatting

     

    Until recently our Windows Forms offering didn’t have support for “HTML - like” rich text formatting, the one so typical for web applications. With the Q3 release shipped on Wednesday, 5-th of November this is about to change.

    This release of RadControls for WinForms has the “HTML - like” formatting capabilities on a framework level.  What does it mean?  Well, as of now every VisualElement descendent is capable of rich text formatting - Labels, Buttons, RadCalendar, RadGridView, etc. The implementation is very simple, especially if your users are familiar with HTML. To turn on the rich formatting behavior you must begin your text with an <html> tag; use <size=[+|-]value> to set the font size used, and <br> to create a new line feed. To bold, underline and italic text styles, use the corresponding opening and closing tags (<i>, <b>, <u>). Font family is set through <font=Family> tag.

    For example, to switch the Button’s text from “Check Mail” to bolded and italic “Check Mail” formatting, you should change the text from “Check Mail” to “<HTML><b>Check</b> <i>Mail</i>”.

    “Check Mail” to rich text “Check Mail”

     

    Here are the Label, Chekbox, ComboBox, Buttons, and ListBox WinForms controls with HTML-like formatting:

    21

    22

    Since this feature is embedded in our framework (TPF), you can also use it in more advanced controls, such as the new RadScheduler and RadGridView. In RadGridView you can use rich-text for the column headers and the actual data cells. To style RadGridView Columns:

    this.radGridView1.Columns["City"].FormatString = "<html><b>City</b>: {0}"; //City will be bold

    this.radGridView1.Columns["ContactName"].FormatString = "<html><Color=red>Name:</b><Color=green> {0}"; //Name will be Red and value will be Green

    this.radGridView1.Columns["Phone"].FormatString = "<html># <u>{0}"; //underline only the number
     

    Rich-format RadGridView Columns


    Using this functionality, users can easily add rich text formatting to their applications. No RTL support is available at the moment.

    What do you think of adding flipping (vertical and rotated ) text capabilities? Will you consider using such feature?

  • What is lacking in your WinForms app?

    My name is Peter and I am a member of the Telerik WinForms team. Today I had to help a customer of ours, who was building a nice looking and very professional LOB application. He was looking for a control that would display the status of a process that he could incorporate in his app.

    The reply was simple, although not so obvious – RadStatusStrip. The status strip is a good example of a very simple piece of UI that does not seems to be of a high importance, but if we take a closer look at the so called LOB apps, we’ll see that it is irreplaceable part of them. A nice-looking and fully-functional status strip control is one of the pieces that developers often omit to include in the specs, but which adds the final touch of any feature-complete app.

    All you need to enhance your WinForms app is to drag the RadStatusStrip control to your form – it will position itself automatically to the bottom of the forms and you can start adding the items you wish to it. Since RadStatusStrip is a full-blown RadControl it can host any RadItems, such as buttons, input controls, progress bars, drop-down menus, and whatever you wish to use. Its appearance is 100% customizable, from both the designer and our WinForms Visual Style Builder.

    With RadStatusStrip, however you can add some extra functionality to your app. Depending on the docking of the control, the orientation changes automatically – horizontal or vertical. This also affects the location of RadStatusStrip’s Resizing Grip. Our customers have found this feature to be very convenient in places where height is limited, or when sidebar functionality is needed.

     

    bottom

     

    right

     

    Another especially unique capability of RadStatusStrip is the support for different Layout Styles:

    clip_image001

     

    In Stack Layout mode RadStatusStrip behaves exactly as you would expect it to, (i.e. as in Word or Visual Studio) – while resizing the application to make it smaller, the right-hand side elements that cannot fit on the form disappear. In this mode, all the elements in RadStatusStrip get a dynamically attached Spring property (set to false), which tells the control whether to stretch and fill up the free space in RadStatusStrip (Spring=true) or not (Spring=false). If there’s more than one element with Spring property set to TRUE, then the free space is filled up proportionally.

     

    Spring

    The uniqueness comes in Overflow mode, where RadStatusStrip arranges elements on more than one line, if there’s not enough space for all elements.

    2 lines

    I hope this little intro on RadStatusStrip will help you add new ficntionality to your application.In case you would like to see any particular functionality to the control, please post a comment here and we will discuss it.

    See you soon.