To achieve this goal, you can disable visual styles, skins, animations, and set various controls options. Note that here we additionally disable visual effects of two most "expensive" controls: RibbonControl and BarManager, which provide bars, docking functionality, context menus, alert windows and a Ribbon interface for your .NET WinForms applications. The attached example shows how to do this by an example of an XAF Windows Forms application. If you do not use XAF, then you can obtain the necessary code from this example, and put it in the entry point of your application (usually it's the Main method).
IMPORTANT NOTE
1. You can greatly reduce memory consumption if you use the BarManager instead of RibbonControl on your forms. For example, an XAF Windows Forms application with BarManager consumes half as much memory than the same application using the RibbonControl. In XAF you can switch between the standard bars and ribbon menu using the FormStyle property of the Options node in the Model Editor.
2. To avoid painting problems when using the RibbonForm and RibbonControl on Vista or Windows 7 with the Aero theme enabled, don't set the System.Windows.Forms.Application.VisualStyleState property to VisualStyleState.NoneEnabled. Alternatively, you can set the RibbonForm.AllowFormGlass property to false. This is because we use the VisualStyleRenderer to draw text on transparent headers.
See Also:
Add a new static property to the XtraAnimator class which will allow a developer to disable animation in all DevExpress controls
Performance Tuning CPU Use for 16 and 32-bit Windows Applications
Build Your Skills: How to optimize apps to run in Terminal Services
Tuning applications for the Terminal Services
Performance Tuning Guidelines for Windows Server 2008
Question Comments
Added By: Carlitos at: 3/9/2015 10:19:37 PM
I am trying this code in my windows client but can't get it to work. In the ResolveTemplate method the formTemplate is always null because the IFrameTemplate template is DevExpress.ExpressApp.Win.Templates.Bars.MainFormV2
Added By: Dennis (DevExpress Support) at: 3/10/2015 5:49:28 AM@Carlos: Starting with v14.2, new templates for the main and detail forms are used in XAF. So, you should check for the RibbonForm type instead of the XtraFormTemplateBase one from within the ResolveTemplate method when customizing the ribbon template. I have attached the updated code below. We'll consider updating this example accordingly in the future.
Added By: Carlitos at: 3/10/2015 11:22:35 AM[C#]usingDevExpress.ExpressApp;usingDevExpress.ExpressApp.Templates;usingDevExpress.ExpressApp.Win.Controls;usingDevExpress.LookAndFeel;usingDevExpress.Skins;usingDevExpress.XtraBars;usingDevExpress.XtraBars.Controls;usingDevExpress.XtraBars.Ribbon;namespaceDisableVisualStylesModule.Win{publicclassDisableVisualStylesWindowController:WindowController{publicDisableVisualStylesWindowController(){TargetWindowType=WindowType.Main;}protectedoverridevoidOnActivated(){base.OnActivated();DisableVisualStyles();}protectedoverridevoidOnDeactivated(){base.OnDeactivated();Application.CustomizeTemplate-=Application_CustomizeTemplate;}privatevoidApplication_CustomizeTemplate(objectsender,CustomizeTemplateEventArgse){ResolveTemplate(e.Template);}protectedvirtualvoidDisableVisualStyles(){if(System.Windows.Forms.SystemInformation.TerminalServerSession){Application.CustomizeTemplate+=Application_CustomizeTemplate;InitGlobalOptions();}}protectedvirtualvoidInitGlobalOptions(){Animator.AllowFadeAnimation=false;SkinManager.DisableFormSkins();SkinManager.DisableMdiFormSkins();BarAndDockingController.Default.PropertiesBar.MenuAnimationType=AnimationType.None;BarAndDockingController.Default.PropertiesBar.SubmenuHasShadow=false;BarAndDockingController.Default.PropertiesBar.AllowLinkLighting=false;System.Windows.Forms.Application.VisualStyleState=System.Windows.Forms.VisualStyles.VisualStyleState.NoneEnabled;}privatevoidResolveTemplate(IFrameTemplatetemplate){IBarManagerHolderformTemplate=templateasIBarManagerHolder;if(formTemplateisRibbonForm){InitRibbonOptions(((RibbonBarManager)formTemplate.BarManager).Ribbon);}else{InitBarOptions(formTemplate.BarManager);UserLookAndFeel.Default.SetWindowsXPStyle();}}protectedvirtualvoidInitRibbonOptions(RibbonControlribbon){if(ribbon!=null){ribbon.ItemAnimationLength= 0;ribbon.GroupAnimationLength= 0;ribbon.PageAnimationLength= 0;ribbon.ApplicationButtonAnimationLength= 0;ribbon.GalleryAnimationLength= 0;ribbon.TransparentEditors=false;InitBarOptions(ribbon.Manager);}}protectedvirtualvoidInitBarOptions(BarManagermanager){if(manager!=null){manager.AllowItemAnimatedHighlighting=false;}}}}
Thank you Dennis! Works like a charm!!!
Added By: Arjan van Dijk at: 7/14/2015 2:40:57 PMYou can also consider ngen.exe to speed up
Added By: Paul Berger at: 9/15/2015 10:02:14 PMIs there an article like this for VCL?
Added By: Dennis (DevExpress Support) at: 9/16/2015 1:06:48 AM@Paul: To process your recent post more efficiently, I created a separate ticket on your behalf: T290221: How to speed up application under Remote Desktop Services (formerly known as Terminal Services) environment. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.