Listbox.AddRow & Listbox.CellCheck

Hi all,

I have a Listbox where the first column contains CheckBoxes

I populate my listbox like this

LB.AddRow "" LB.CellCheck( LB.LastIndex, 0 ) = True

Might be a silly question, but is it possible to combine these? Something like

LB.AddRow True

[quote=130018:@Markus Winter]Might be a silly question, but is it possible to combine these? Something like

LB.AddRow True[/quote]

No you cannot do that with the AddRow method. But you could create a myAddRow method that does just that.

In the Open event of your listbox put

me.ColumnType(0) = Listbox.TypeCheckbox

now just do

LB.addrow ""

and your first column will always be a checkbox

[quote=130051:@Roger Clary]In the Open event of your listbox put

me.ColumnType(0) = Listbox.TypeCheckbox

now just do

LB.addrow ""

and your first column will always be a checkbox[/quote]

What he wants to do, as far as I understand, is addrow with a boolean instead of a string.

You could write an extends method for ListBox that would do that for you.

Thanks guys.