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.
Post Reply
olivier56
Posts: 9
Joined: Fri Mar 27, 2020 8:27 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: 653
Joined: Thu Jun 01, 2017 7:20 am
Answers: 8
Been upvoted: 7 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: 14677
Joined: Tue May 22, 2007 9:57 am
Answers: 6
Has voted: 1 time
Been upvoted: 5 times
Contact:

Re: create checkbox automatic from text

Post by jvierra »

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

olivier56
Posts: 9
Joined: Fri Mar 27, 2020 8:27 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: 9
Joined: Fri Mar 27, 2020 8:27 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: 14677
Joined: Tue May 22, 2007 9:57 am
Answers: 6
Has voted: 1 time
Been upvoted: 5 times
Contact:

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: 9
Joined: Fri Mar 27, 2020 8:27 am

Re: create checkbox automatic from text

Post by olivier56 »

hi

thank you

br

Post Reply