Search code examples
wpfcitrixwinforms-interop

Winform display issue in citrix


I am hosting a Winform control in WPF using WindowsFormsHost and when this application is launched in Citrix environment, Winform UI is displayed blue in color as shown in the below image: Winform displayed in Citrix

Nothing is clean in the above image.
I am already using below setting in WPF application but it is not fixing this issue.

System.Windows.Forms.Application.EnableVisualStyles() 

Any advice on how to fix this will be great.


Solution

  • This issue used to come because of change in Windows theme from Windows7 to Windows classic. The winform control back color set was System.Drawing.SystemColors.ActiveCaption. This color itself changes to dark blue as shown in the above image when theme is changed to Windows classic. To fix this i changed to back color of the winform control itself.