none
Styling Forms to Match Outlook Native Forms

    Question

  • How do we make the style, look and feel of the Form Regions in our Outlook Add-In match those of the native Outlook (2010) forms, such as New Message and Add Contact?  The rounded buttons and styling of text boxes are wonderful.

    Is this hard to do?  Is it even possible?

    Tuesday, December 17, 2013 4:51 PM

Answers

All replies

  • Hello Peter,

    Could you please take a screenshot and underline controls you want to render on your own form? Is it a ribbon control?


    Tuesday, December 17, 2013 5:04 PM
  • When you're designing a form region open the toolbox and right-click to add additional controls. Add all of the OLK* controls. Those use Windows styles and have that "rounded" look.

    Be aware those are wrappers on the original non-themed Forms 2.0 controls and are intended for use only on form regions. They may not work or work correctly on standard Outlook custom forms.


    Ken Slovak MVP - Outlook

    Tuesday, December 17, 2013 6:42 PM
  • The first image is of the native New Message form in my Outlook 2010.

    The second one is an attempt, just for this post, to create the form using the standard controls provided in VS2012 for OL2010 Form Regions.

    It may not seem very different, but the buttons and borders on the controls used by native forms looks way cooler, to me, than the standard (seemingly clunky) ones provided by Visual Studio.

    I am researching the OLK* controls.  I don't see them among the list of items when I go to add new tools to the toolbox.



    Tuesday, December 17, 2013 10:02 PM
  • Hello Peter,

    In the ctor of you Outlook form region you can try to paste the following code (before the InitializeComponent call): 

    System.Windows.Forms.Application.EnableVisualStyles();
    Is it what you are looking for?
    Thursday, December 19, 2013 4:41 PM
  • Enabling visual styles won't help at all in theming the controls in an Outlook form region. Using the OLK* controls will theme the controls correctly using visual styles.

    In the form region designer in Outlook if the controls toolbox is right-clicked and Additional Controls is selected the OLK* controls are listed as "Microsoft Outlook Checkbox Control", and so on. All those controls start with "Microsoft Outlook".


    Ken Slovak MVP - Outlook

    Thursday, December 19, 2013 6:00 PM
  • Enabling visual styles won't help at all in theming the controls in an Outlook form region. Using the OLK* controls will theme the controls correctly using visual styles.

    In the form region designer in Outlook if the controls toolbox is right-clicked and Additional Controls is selected the OLK* controls are listed as "Microsoft Outlook Checkbox Control", and so on. All those controls start with "Microsoft Outlook".


    Ken Slovak MVP - Outlook

    Hello Ken, and thank you for the reply.

    I followed your instructions and I now see these controls in the Outlook Designer.  But can I work with these controls in the Visual Studio (2012) Form Designer?

    I seek the use, access and manipulation of these controls using Visual Studio, because its Form Designer is much more robust and offers me access to other controls, such as the TableLayoutPanel and other welcome features.

    Thursday, December 19, 2013 6:47 PM
  • Not directly from Visual Studio no. Only from the Outlook form region designer.

    But you can start the design using that and then import the design into VS after. See http://msdn.microsoft.com/en-us/library/bb608611.aspx


    Ken Slovak MVP - Outlook

    Thursday, December 19, 2013 6:55 PM