Create Themes?

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create Themes?

Post by jvierra »

Ok David. Drop a hint. Which method are you working on???

Sounds good to me so far.
User avatar
apowershelluser
Posts: 194
Last visit: Fri Mar 22, 2024 4:38 am
Answers: 2

Re: Create Themes?

Post by apowershelluser »

I did see this..

https://twitter.com/jbirley/status/1113588744286871552

Either way, I'm excited. Like jvierra said we need hints!
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Create Themes?

Post by davidc »

Just in regards to themes and WinForms. Nothing too fancy.
David
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create Themes?

Post by jvierra »

Here is a themer on steroids for WinForms https://www.codeproject.com/Articles/75 ... rms-Themes

There are quite few using various methods. Most work at the compiler level which is actually easy to build in Visual Studio using either a settings file or a custom XML file. XML can be databound to forms.

I just use the XML and walk the XML hierarchy and use the tags, names and properties to apply customization.

All of these methods are not true themes but allow most customizations. Getting fancy in PS requires al lot of "paint" overrides.

It would be excellent if Sapien would work on implementing support for data binding and for adding third party controls.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create Themes?

Post by jvierra »

When the PSF files were all XML I would just cut the XML and place it in a new file then edit it to add property changes. I can't find that old project. I guess PSFs have not been XML for quite some time.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create Themes?

Post by jvierra »

Here is a part of an old PFF file. It cn be easily bulk edited to allow it to be used as a base for a style setter.

Code: Select all

<FileID>a71c33c8-f804-404b-8d3b-e67696b5e014</FileID>
  <FileVersion>1.2</FileVersion>
  <Object type="System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="form1" children="Controls">
    <Property name="AcceptButton">
      <Reference name="buttonOK" />
    </Property>
    <Property name="ClientSize">284, 262</Property>
    <Property name="FormBorderStyle">FixedDialog</Property>
    <Property name="MaximizeBox">False</Property>
    <Property name="MinimizeBox">False</Property>
    <Property name="Name">form1</Property>
    <Property name="StartPosition">CenterScreen</Property>
    <Property name="Text">Form</Property>
    <Event name="Load">FormEvent_Load</Event>
    <Object type="System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="buttonDisable" children="Controls">
      <Property name="Font">Microsoft Sans Serif, 8.25pt, style=Bold</Property>
      <Property name="Location">177, 42</Property>
      <Property name="Name">buttonDisable</Property>
      <Property name="Size">75, 23</Property>
      <Property name="TabIndex">3</Property>
      <Property name="Text">Disable</Property>
      <Property name="UseVisualStyleBackColor">True</Property>
      <Event name="Click">buttonDisable_Click</Event>
    </Object>
  
The plus is all of the controls ae in the correct hierarchy and many of the properties can be set at runtime. The XML was a good bootstrap.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create Themes?

Post by jvierra »

JohnTitor wrote: Wed Apr 10, 2019 2:13 pm I did see this..

https://twitter.com/jbirley/status/1113588744286871552

Either way, I'm excited. Like jvierra said we need hints!
Yup. Got that from the Team blog last week. It will be the first version that can truly run cross-platform with few limitations. Soon no more 5.1.
This topic is 4 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked