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 2019 5.6.161
32 or 64 bit version of product: 64 bit
Operating system: Windows 10
32 or 64 bit OS: 64bit
*** Please add details and screenshots as needed below. ***
Ok, I have set up a column in my datagridview to display status, so far easy peasy. I've added my icon file to column image (as default) - see ss1.png and this displays fine in my form, see ss2.png
However, if I want to change the icon programmatically if status changed, then icon displays much bigger (have used same icon file as wanted to ensure nothing different with icon files). As you can see from screenshot ss3.png), the icon is much larger.
I've used the following code:
$crossIcon = [system.drawing.icon]::ExtractAssociatedIcon("I:\xxxx\Hopstarter-Rounded-Square-Button-Ok.ico")
foreach ($user in $ecsgextcollusers) { $dgvECSGUsers.Rows.Add($crossIcon, $user.name, $user.description,"Collaborator") }
Any ideas how I ensure same size as default loaded ones?
Regards
Ian
datagridviewimagecolumn size of icon
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
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 LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: datagridviewimagecolumn size of icon
Oops, forgot screenshots...attached now.
- Attachments
-
- ss3.PNG (2.97 KiB) Viewed 2004 times
-
- ss2.PNG (1.51 KiB) Viewed 2004 times
-
- ss1.PNG (1.86 KiB) Viewed 2004 times
Re: datagridviewimagecolumn size of icon
Fixed or at least a workaround.
I changed code to (and used different icon file to test) :
$crossIcon = [system.drawing.image]::FromFile("I:\xxxxx\Hopstarter-Rounded-Square-Button-Delete.ico")
As you can see, this had the desired result.
Cheers
Ian
I changed code to (and used different icon file to test) :
$crossIcon = [system.drawing.image]::FromFile("I:\xxxxx\Hopstarter-Rounded-Square-Button-Delete.ico")
As you can see, this had the desired result.
Cheers
Ian