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.
This topic is 3 years and 2 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
olivier56
Posts: 16
Last visit: Tue Jan 09, 2024 6:58 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: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: create checkbox automatic from text

Post by brittneyr »

[Topic moved by moderator to PowerShell GUI forum]
Brittney
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 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: 16
Last visit: Tue Jan 09, 2024 6:58 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: 16
Last visit: Tue Jan 09, 2024 6:58 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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 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: 16
Last visit: Tue Jan 09, 2024 6:58 am

Re: create checkbox automatic from text

Post by olivier56 »

hi

thank you

br
This topic is 3 years and 2 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