To help you better we need some information from you.
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build: PowerShell Studio 2017 v5.4.145
32 or 64 bit version of product: 64 bit
Operating system: Win 10
32 or 64 bit OS: 64 bit
*** Please add details and screenshots as needed below. ***
Anyway to fix this behavior so its the image and then the text both aligned left. I had previously done this in a form I created manually in PS before I purchased PS Studio in a ps1 file and it behaved properly aligning the image and then the text both with ImageAlign and TextAlign set to MiddleLeft using an ImageList and ImageIndex.
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Text overwriting image in label control with image and text aligned middle left
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.
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.
Re: Text overwriting image in label control with image and text aligned middle left
[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Text overwriting image in label control with image and text aligned middle left
I recommend using a PictureBox in addition to a label, this way you can ensure they don't overlap.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Text overwriting image in label control with image and text aligned middle left
I thought about doing it that way I wanted to bring it to someone's attention as a possible bug in PS Studio. I found this because I was trying to convert a gui that I wrote manually in native PS to PS Studio. When I did the same thing natively in PS using New-Object System.Windows.Forms.Label setting the same properties I did in PS studio the alignment was fine and the text did not overwrite the label image.
Re: Text overwriting image in label control with image and text aligned middle left
Can't be PSS. The settings are generated exactly like you do it in a hand coded form. Dump the PS1 and look at the code.
I suspect you have some odd setting that is not set as you expect.
I suspect you have some odd setting that is not set as you expect.
Re: Text overwriting image in label control with image and text aligned middle left
There could be a bug when the app generates the label code. My PS Studio screen shot definitely show the over lap where my native PS does not and I verified my native code settings with the same settings in PS Studio properties pane. My goal was to re-do my natively coded project in PS Studio since the form creation is much easier. This is the issue I found when trying to do that. I'm also finding an issue with the treeview control. I use an imagelist and successfully change the images I set the ImageIndex and SelectedImageIndex to the same value for all the nodes because I don't want them to change whne selected. This works fine in preview and as long as I keep the project open. If I close and reopen the project all ImageIndex and SelectedImageIndex values default to 0 the first image in the image list. This to also works fine in my native PS code and only seems to be an issue in the PS Studio version.
Re: Text overwriting image in label control with image and text aligned middle left
Your native code is not setting the form correctly. The form has to be designed the exact way as PSS creates the form.
Create a simple PSS app and look at how the code is generated in the PS1. Compare that to a hand coded script and check that you are crating the form using the correct styles.
PSS does NOT create code that is not PowerShell. Dump the PS1 and run it and it will work correctly. The PS1 generated is exactly what PSS runs. It does not do anything differently.
You need to be sure visual styles are set correctly and that the rendering properties of the form are the same as PSS. YOu also need to be sure that you are setting the DPI rendering correctly for hi-res monitors. Simpler forms not using visual styles will display differently and may be far off on hi-res monitors.
Without a clear code example there is really no way to address your issue.
Create a simple PSS app and look at how the code is generated in the PS1. Compare that to a hand coded script and check that you are crating the form using the correct styles.
PSS does NOT create code that is not PowerShell. Dump the PS1 and run it and it will work correctly. The PS1 generated is exactly what PSS runs. It does not do anything differently.
You need to be sure visual styles are set correctly and that the rendering properties of the form are the same as PSS. YOu also need to be sure that you are setting the DPI rendering correctly for hi-res monitors. Simpler forms not using visual styles will display differently and may be far off on hi-res monitors.
Without a clear code example there is really no way to address your issue.
Re: Text overwriting image in label control with image and text aligned middle left
I apologize if my previous post wasn't clear. I created the project originally natively in PS creating the forms and tediously positioning the controls without the use of PS Studio and the label images displayed properly in the label control as in the first image I attached to this post which is from my original project. I then attempted to recreate my original project in PS Studio obviously because building the forms are much easier then doing it by hand with native PS code. That's when I encountered the second image I posted. I tried this both with and without visual styles enabled [System.Windows.Forms.Application]::EnableVisualStyles() with the same resulting text overwriting the image in both cases. I can zip the project and attach its currently only 2 forms at this point if that will help.
Re: Text overwriting image in label control with image and text aligned middle left
Pictures are not code. There is no way to know what you are doing without the PSF file. Remember that, on hi-res monitors you will need to make adjustments to get things to display correctly.
From what you have posted it is not possible to know what is happening.
From what you have posted it is not possible to know what is happening.