create checkbox automatic from text

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.
Locked
olivier56
Posts: 10
Last visit: Thu Sep 23, 2021 7:43 am

create checkbox automatic from text

Post by olivier56 »

Hello
I would like to know how to create checkboxes automatically according to a number of lines in a notepad:
for example in the note pad I have blue green red
I would like that when the form is opened, there are as many checkboxes as there are lines with the corresponding name.

thank you for your return
br

User avatar
brittneyr
Site Admin
Posts: 893
Last visit: Tue Oct 19, 2021 2:56 pm
Answers: 20
Been upvoted: 17 times

Re: create checkbox automatic from text

Post by brittneyr »

[Topic moved by moderator to PowerShell GUI forum]
Brittney Ryn
SAPIEN Technologies, Inc.

jvierra
Posts: 14951
Last visit: Sun Oct 17, 2021 11:52 am
Answers: 14
Has voted: 3 times
Been upvoted: 11 times

Re: create checkbox automatic from text

Post by jvierra »

Use a CheckedListBox and load the array of lines directly into the CheckedListBox.

olivier56
Posts: 10
Last visit: Thu Sep 23, 2021 7:43 am

Re: create checkbox automatic from text

Post by olivier56 »

hi
thank you
work fine but now i would like have value checked in checklistbox

for each checked item do
m my code

thanck you

olivier56
Posts: 10
Last visit: Thu Sep 23, 2021 7:43 am

Re: create checkbox automatic from text

Post by olivier56 »

hi
i find how
but how i can do this
$valeur= "showonly:" + $checkedlistbox1.CheckedItems make that aubouttototutu
I would have this :
aubout;toto;tutu
how i can do it
br

jvierra
Posts: 14951
Last visit: Sun Oct 17, 2021 11:52 am
Answers: 14
Has voted: 3 times
Been upvoted: 11 times

Re: create checkbox automatic from text

Post by jvierra »

Your question is not understandable.

Start here: https://info.sapien.com/index.php/guis/ ... nistrators

There are articles for most controls that will explain how to use them. You can also access the articles by right-clicking on the control in the toolbox.

olivier56
Posts: 10
Last visit: Thu Sep 23, 2021 7:43 am

Re: create checkbox automatic from text

Post by olivier56 »

hi

thank you

br

Locked