checkedlistbox itemHeight

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 3 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
User avatar
JaimeBou
Posts: 27
Last visit: Wed Jan 31, 2024 8:52 am
Has voted: 1 time

checkedlistbox itemHeight

Post by JaimeBou »

I am using a checkedlistbox and would like to space out the items and seemingly can't make it work.

I did some reading and from what I found this should have worked:

$checkedlistboxHM_DC1.DrawMode = 'OwnerDrawVariable'
$checkedlistboxHM_DC1.ItemHeight = 40

It's not working and I can't seem find anything else documented on how this would work.

Could you help please?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: checkedlistbox itemHeight

Post by jvierra »

What does "space out the items " mean?
User avatar
JaimeBou
Posts: 27
Last visit: Wed Jan 31, 2024 8:52 am
Has voted: 1 time

Re: checkedlistbox itemHeight

Post by JaimeBou »

I have several items in the checkedlistbox and would like to change the vertical spacing between the items.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: checkedlistbox itemHeight

Post by jvierra »

To change the spacing set the font to one that has more spacing.
User avatar
JaimeBou
Posts: 27
Last visit: Wed Jan 31, 2024 8:52 am
Has voted: 1 time

Re: checkedlistbox itemHeight

Post by JaimeBou »

Thank you for your suggestion.
Although it may be the only option, it's really not a good one.
It would save a lot of time if you have a suggested font with more spacing.
As it stands, I would have to go through the list of each font and see if the spacing would work.

Thanks again.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: checkedlistbox itemHeight

Post by jvierra »

This is an example of how this works:
Attachments
Test-CheckedList Spacing.psf
(21.8 KiB) Downloaded 132 times
User avatar
JaimeBou
Posts: 27
Last visit: Wed Jan 31, 2024 8:52 am
Has voted: 1 time

Re: checkedlistbox itemHeight

Post by JaimeBou »

Got it.

Thank you sir.
This topic is 3 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