Forum > LCL

Referring to TCheckGroup items by caption


Sometimes it's not convenient to look for checked items through TCheckGroup.Checked[<Integer>], since the index will change when the order is changed. Is there any other property to access it by caption ? e.g. TCheckGroup.Checked['An item']

TCheckGroup's Items are TStrings, so you can use IndexOf.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var idx:Integer;begin  idx:=CheckGroup1.Items.IndexOf('zwei');  if idx>-1 then CheckGroup1.Checked[idx]:=true;end;  

Doh!, I didn't realize that. Thanks
* .


[0] Message Index

Go to full version