Hi,
I have created a simple one button form with PrimalForms (Community Edition) v1.0.8.0
When I open it from the Powershell ISE the button has rounded corners and a 3D look.
When I open the form straight with powershell the button is boxey and plain.
I have XP SP3.
Any tips?
Thanks
3d look of form elements
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
3d look of form elements
That is a pretty common occurance. The visual design of standard windows controls depends on which version of common controls is loaded.
Modern applications use a manifest to pull in a new version of those controls. Older applications, applications without manifest (e.g. console applications) or applications meant to be compatible with previous Windows versions don't do that.
Please refer to these articles:
http://www.sapien.com/blog/2009/01/15/s ... -features/
http://www.sapien.com/blog/2008/09/07/w ... -manifest/
http://www.sapien.com/blog/2008/09/05/s ... manifests/
Modern applications use a manifest to pull in a new version of those controls. Older applications, applications without manifest (e.g. console applications) or applications meant to be compatible with previous Windows versions don't do that.
Please refer to these articles:
http://www.sapien.com/blog/2009/01/15/s ... -features/
http://www.sapien.com/blog/2008/09/07/w ... -manifest/
http://www.sapien.com/blog/2008/09/05/s ... manifests/
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
3d look of form elements
Hi, Thanks for the info.
So, to get the more modern GUI look and feel I need a manifest.
And to use a manifest, the code must be run from an exe.
I don't want to package my scripts, so can you confirm there is no point investigating this further?
Cheers. painter2010-08-29 03:18:56
So, to get the more modern GUI look and feel I need a manifest.
And to use a manifest, the code must be run from an exe.
I don't want to package my scripts, so can you confirm there is no point investigating this further?
Cheers. painter2010-08-29 03:18:56
3d look of form elements
Actually I found adding the following in bold under this section worked
(and I did not have to run powershell -sta as stated where I found the tip)
#region Import the Assemblies[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[System.Windows.Forms.Application]::EnableVisualStyles()
Can you see this causing any problems?
(and I did not have to run powershell -sta as stated where I found the tip)
#region Import the Assemblies[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[System.Windows.Forms.Application]::EnableVisualStyles()
Can you see this causing any problems?
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
3d look of form elements
Yes, you are correct, I forgot about that call. It shouldn't have any side effects. The STA flag usually depends more on what type of control you use rather than how it is drawn.
As far as I recall file dialogs and some grids require STA.
As far as I recall file dialogs and some grids require STA.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.