Xojo Conferences
XDCMay2019MiamiUSA

Re: Listbox Checkbox value (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Re: RoundRectangle
Next thread: e: Thought I'd share some icons


Re: Listbox Checkbox value   -   Kim Kohen
  Re: Listbox Checkbox value   -   Steve Garman
  Re: Listbox Checkbox value   -   Arnaud Nicolet
  Re: Listbox Checkbox value   -   Kim Kohen

Re: Listbox Checkbox value
Date: 30.07.08 09:35 (Wed, 30 Jul 2008 18:35:20 +1000)
From: Kim Kohen
On 30/07/2008, at 4:29 PM, Kirk Gray wrote:

> Something like:
>
> If myListBox.CellCheck( Row, Column ) THEN
> doSomething
> Else
> doSomehthingDifferent
> End

that's exactly what I thought but...

It seems cellcheck only sets the checkability of the cell (allowing it
to be checked or not), rather than returning the value (happy to see
an example demonstrating otherwise).

This;

if me.CellCheck(3,0) then
MsgBox "on"
else
MsgBox "off"
end if

always returns off, regardless of the state of the checkbox, as does
this

if me.CellCheck(3,0) = true then
MsgBox "on"
else if me.CellCheck(3,0) = false then
MsgBox "off"
end if

This seems strange. I use lots of checkboxes and have never had a
problem getting the values but it appears a checkbox in a listbox
don't share the same behaviour.

the LR says: "Checks or unchecks the checkbox in the passed cell. Row
and Column are zero-based." but it appears the value can't be read.

Any other suggestions?

/k
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Listbox Checkbox value
Date: 30.07.08 10:48 (Wed, 30 Jul 2008 10:48:36 +0100)
From: Steve Garman
> It seems cellcheck only sets the checkability of the cell (allowing it
> to be checked or not), rather than returning the value (happy to see
> an example demonstrating otherwise).

This simple test works for me.

Create a new project and add a listbox *ListBox1) to the default window.
in its open event, put:

for i as Integer = 0 to 5
me.AddRow Format( i, "0" )
me.CellType(i, 0 ) = Listbox.TypeCheckbox
next

Add a pushbutton to the window with the following action event:

if Listbox1.CellCheck(3,0) then
MsgBox "on"
else
MsgBox "off"
end if

Re: Listbox Checkbox value
Date: 30.07.08 10:50 (Wed, 30 Jul 2008 11:50:09 +0200)
From: Arnaud Nicolet

Le 30 juil. 08 à 10:35 (matin), Kim Kohen a écrit:

> On 30/07/2008, at 4:29 PM, Kirk Gray wrote:
>
>> Something like:
>>
>> If myListBox.CellCheck( Row, Column ) THEN
>> doSomething
>> Else
>> doSomehthingDifferent
>> End
>
> that's exactly what I thought but...
>
> It seems cellcheck only sets the checkability of the cell (allowing
> it to be checked or not), rather than returning the value (happy to
> see an example demonstrating otherwise).
>
> This;
>
> if me.CellCheck(3,0) then
> MsgBox "on"
> else
> MsgBox "off"
> end if
>
> always returns off, regardless of the state of the checkbox, as
> does this
>
> if me.CellCheck(3,0) = true then
> MsgBox "on"
> else if me.CellCheck(3,0) = false then
> MsgBox "off"
> end if
>
> This seems strange. I use lots of checkboxes and have never had a
> problem getting the values but it appears a checkbox in a listbox
> don't share the same behaviour.
>
> the LR says: "Checks or unchecks the checkbox in the passed cell.
> Row and Column are zero-based." but it appears the value can't be
> read.
>
> Any other suggestions?

Just to check: you are using the correct parameters, right? (first
the row, then the column). I recall I made the mistake several times:
confusing row and column, and, obviously, this lead to unexpected
results.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Listbox Checkbox value
Date: 30.07.08 12:05 (Wed, 30 Jul 2008 21:05:43 +1000)
From: Kim Kohen
On 30/07/2008, at 7:50 PM, Arnaud Nicolet wrote:

> Just to check: you are using the correct parameters, right? (first
> the row, then the column). I recall I made the mistake several
> times: confusing row and column, and, obviously, this lead to
> unexpected results.

oh crap, don't you hate that. didn't confuse them, just used the wrong
numbers.

I've spent the whole day writing sql targeting (l1.listindex,0) and
it's just stuck in my mind. For this other listbox, the cell should
have been (3,1) not (3,0) - sorry. <blush>

/k

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>