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
Joined: Fri Mar 27, 2020 8:27 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: 14691
Joined: Tue May 22, 2007 9:57 am
Answers: 7
Has voted: 2 times
Been upvoted: 5 times

Re: persitence cheked checklistbox

Post by jvierra »

No. You will have to recheck them.

olivier56
Posts: 9
Joined: Fri Mar 27, 2020 8:27 am

Re: persitence cheked checklistbox

Post by olivier56 »

ok
thank you

if i use ini file or registrery may be

br

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