none
Different Version of GUI Elements *confusing* RRS feed

  • Question

  • Hey guys,

    why do i get different Version of GUI Elements when i start my script using the Powershell Console or the Powershell ISE.
    E.g. System.Windows.Forms.MonthCalendar.
    My Profile is the same in both Environment and even $psversiontable Shows me the same Information.

    Thanks for your help
    Manuel

    Friday, November 28, 2014 1:56 PM

Answers

  • They use different visual styles, you can add this to your form to make it look the same as the ISE version when run from the console

    [System.Windows.Forms.Application]::EnableVisualStyles()

    • Proposed as answer by jrv Friday, November 28, 2014 2:16 PM
    • Marked as answer by Manuel Siegert Friday, November 28, 2014 2:38 PM
    Friday, November 28, 2014 2:15 PM

All replies

  • ISE Version:

    ISE Version

    Powershell Console Version:

    Powershell Console Version

    Friday, November 28, 2014 2:05 PM
  • They use different visual styles, you can add this to your form to make it look the same as the ISE version when run from the console

    [System.Windows.Forms.Application]::EnableVisualStyles()

    • Proposed as answer by jrv Friday, November 28, 2014 2:16 PM
    • Marked as answer by Manuel Siegert Friday, November 28, 2014 2:38 PM
    Friday, November 28, 2014 2:15 PM
  • Also note that different versions of Windows may have slightly different controls and control defaults.  In this case the visual styles should do it but if it doesn't the just explicitly sett the calendar type you want to use.

    ¯\_(ツ)_/¯

    Friday, November 28, 2014 2:18 PM
  • thx for the quick answer :).
    Friday, November 28, 2014 2:38 PM