GUI with TabControl

hi all,

Not new to PowerShell but new to GUI creation.

before I start working on my GUI, I would like to know if it is possible to start the compiled exe and open the tool to a pre-defined tab, depending on a parameter passed to the exe?


What you do in your firm code is what allows this. Specifically the OnLoad or OnActivate or OnFocus event actions.

You say you are new to GUI, this is really a conversation about application development. Please spend the time ramping up on Windows Forms and Windows Presentation foundation, without PowerShell efforts first. Building basic Windows Apps, then you can add the PowerShell specific needs later. Use MS Virtual Academy, MS Learn, YouTube, MSDN Channel 9, and the many MSDN developer sites to wrap your head around this.

I am not sure what you mean by compiled .exe, but I am going to assume you either plan to use PS2EXE

to Covent your code to an .exe or you are using Sapien’s PowerShell Studio

or your are using Visual Studio to do this.

I use PowerShell Studio and I’m not THAT new :wink:

I did some training on WPF but I was not sure about opening my form with the focus on a specific tab. I’ll dig it up more.


Ah, OK.

I’ve been a PSStudio user for years, now.
However, the big thing about SPSS, is that it is WinForms only. We all have been hammering at them to support WPF for a few years now. So far, no action from them.

So, to do this, leverage Visual studio and get the PowerShell extension for it as well. This way you get drug and drop from builder for WinForms and WPF. With the PS extension, it becomes a full PS project in Visual Studio for PowerShell.

To save some money as you learn, just use the Visual Studio Community Edition, which is free, and is the full VS, not some limited version.