Learned something new about PowerShell forms today

I’ve been working on a form app using PowerShell. This particular app provides an initialization form window fooled by the main window.

I had already run across that the initialization form would not run if I used the standard ShowDialog method since PowerShell forms run one per console. The solution was to use the Show method for the initialization form window.

That led to my next discovery : a label object (System.Windows.Forms.Label) will not display properly if the Show method is used to display the form. Instead all that appears is a white box. The solution was to use a textbox object instead.


UPDATE : I found that if the Refresh method is used on the label it will show as it should.


Comments are closed.