Make Listbox Checkbox Cell Non-Editable

Is there a way? Why would a cell of CellTypes.CheckBox be editable?

Me.ColumnTypeAt(Col) = Listbox.CellTypes.CheckBox

Screen Shot 2021-11-08 at 10.08.52 AM

This

Me.ColumnTypeAt(Col) = Listbox.CellTypes.Normal
Me.ColumnTypeAt(Col) = Listbox.CellTypes.CheckBox

doesn’t fix it.

Simply reset the value.

me(whatever).value = not me(whatever).value

You could put the checkbox in its own column.

Edit: punctuation

As far as I know, it is in its own column.

I put a listbox in a window, give it some columns in the Inspector, and in its Open event I set the ColumnTypes, with this particular column being set to CellTypes.CheckBox. Why is it acting like a CellTypes.TextField with a checkbox in it?

I must be missing something.

Sorry Beatrix I don’t understand what you’re saying. My question has nothing to do with anything.value. I just want a listbox cell with only a checkbox in it, not a listbox cell with a checkbox that also behaves as an editable textfield.

I think what Tim meant is reduce the cell width to hold only the checkbox itself, then put any desired text in the adjacent column.

1 Like

That does solve part of the problem, but then I have a checkbox column with no heading to identify what the checkbox means :slight_smile:

There is no text associated with this column, it should just be a column of checkboxes. The checkboxes’ function is stated in the column heading.

Ah, you need to dream up a fancy icon to head that column.

1 Like

What version of Xojo are you using?
Do you have an example project that shows the issue?

I don’t see this problem in Lifeboat with a Checkbox type column with text in it.

2021r2.1

My current project with the issue is a behemoth, but I’ll try to make a test project.

I’m not able to reproduce it in a simple test project (available here). Maybe you have a MouseDown/EditCell combination in your project?

1 Like

Never mind, my bad. Code in CellClick was calling EditCell. Thanks for the input, all, and sorry for the churn.