persitence cheked checklistbox

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: 9
Last visit: Fri Jan 29, 2021 5:36 am

persitence cheked checklistbox

Post by olivier56 »

Hello,
it is possible to leave the boxes checked after closing the interface and then opening it again.
thank you

jvierra
Posts: 14759
Last visit: Fri Apr 16, 2021 10:47 pm
Answers: 9
Has voted: 3 times
Been upvoted: 7 times

Re: persitence cheked checklistbox

Post by jvierra »

No. You will have to recheck them.

olivier56
Posts: 9
Last visit: Fri Jan 29, 2021 5:36 am

Re: persitence cheked checklistbox

Post by olivier56 »

ok
thank you

if i use ini file or registrery may be

br

olivier56
Posts: 9
Last visit: Fri Jan 29, 2021 5:36 am

Re: persitence cheked checklistbox

Post by olivier56 »

hi

work fine

Code: Select all

$EmplacementFichier2 = [string]
	$EmplacementFichier2 = "d:\test.txt"
	$MyArray= get-content $EmplacementFichier2
	foreach ($Item in $MyArray)
	{
		# Check it ...
		$CheckedListBox1.SetItemChecked($checkedlistbox1.Items.IndexOf($Item), $true);
	}
	



Locked