Xojo Conferences
XDCMay2019MiamiUSA

Listbox, cell(i,j).TypeEditable (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: memoryblock parameters
Next thread: Setting PreserveWhiteSpace in XMLDocument


Win32 API Declares   -   Berg, Heath
  Listbox, cell(i,j).TypeEditable   -   Ronald Vogelaar
   Re: Listbox, cell(i,j).TypeEditable   -   CV
    Re: Listbox, cell(i,j).TypeEditable   -   Ronald Vogelaar
   Re: Listbox, cell(i,j).TypeEditable   -   Joseph J. Strout

Listbox, cell(i,j).TypeEditable
Date: 31.01.05 23:43 (Mon, 31 Jan 2005 23:43:50 +0100)
From: Ronald Vogelaar
Hi All,

How can I quickly set all cells in a listbox to TypeEditable? I tried the
following, but it gave me an outofboundsexception:

for ito listbox1.columncount
listbox1.columntype(i)=Listbox.TypeEditable
next

I even tried the following, but I was greeted with the same goodbye message:

for i= 0 to listbox1.listcount
for jto listbox1.columncount
listbox1.celltype(i,j)=Listbox.TypeEditable
next
next

Thanks in advance,

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Listbox, cell(i,j).TypeEditable
Date: 01.02.05 07:12 (Tue, 1 Feb 2005 00:12:24 -0600)
From: CV
Incidently, your code below(the second snippet from your original post)
is not out of bounds on CellType(i, j). It is out of bounds on
ListBox1.ListCount, which must be ListBox1.ListCount - 1.

In other words, try this somewhere, with ListBox1 set to ColumnCount =
2 in the Properties Window:

dim i, j as integer
ListBox1. addrow "dog"
for i = 0 to Listbox1.ListCount - 1 // change your line to this
for j = 0 to ListBox1.ColumnCount
ListBox1.CellType(i, j) = ListBox.TypeEditable // same as yours
Next
Next

That is identical to your code except for changing LIstCount to
ListCount - 1. There is no out of bounds exception, even though j goes
to 2, which is the index of a 3rd column, while ColumnCount is two.

Your two code snippets bring out the fact that the "cell"
properties/methods listed below can access all 64(0-63) listbox columns
of the listbox, regardless of the value of ColumnCount, without
generating OOBEs:

Cell(row,column)
CellTag(row,column)
CellType(row,column)
CellAlignment(row,column)
CellAlignmentOffset(row,column)
CellCheck(row,column)
CellBold(row,column)
CellItalic(row,column)
CellUnderline(row,column)
InvalidateCell(row,column)

This is not the case for ColumnAlignment(column),
ColumnAlignmentOffset(column), ColumnSortDirection(column), and, as you
discovered: ColumnType(column).

HTH, well...interesting issue anyway :-)

Jack

> for i= 0 to listbox1.listcount
> for jto listbox1.columncount
> listbox1.celltype(i,j)=Listbox.TypeEditable
> next
> next
>
> Thanks in advance,
>

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Listbox, cell(i,j).TypeEditable
Date: 01.02.05 11:52 (Tue, 01 Feb 2005 11:52:28 +0100)
From: Ronald Vogelaar
Thanks Joe, CV. It's (obviously) working now.

Ronald Vogelaar
http://www.rovosoft.com

On 2/1/05 7:12 AM, "CV" <<email address removed>> wrote:

> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Incidently, your code below(the second snippet from your original post)
> is not out of bounds on CellType(i, j). It is out of bounds on
> ListBox1.ListCount, which must be ListBox1.ListCount - 1.
>
> In other words, try this somewhere, with ListBox1 set to ColumnCount > 2 in the Properties Window:
>
> dim i, j as integer
> ListBox1. addrow "dog"
> for i = 0 to Listbox1.ListCount - 1 // change your line to this
> for j = 0 to ListBox1.ColumnCount
> ListBox1.CellType(i, j) = ListBox.TypeEditable // same as yours
> Next
> Next
>
> That is identical to your code except for changing LIstCount to
> ListCount - 1. There is no out of bounds exception, even though j goes
> to 2, which is the index of a 3rd column, while ColumnCount is two.
>
> Your two code snippets bring out the fact that the "cell"
> properties/methods listed below can access all 64(0-63) listbox columns
> of the listbox, regardless of the value of ColumnCount, without
> generating OOBEs:
>
> Cell(row,column)
> CellTag(row,column)
> CellType(row,column)
> CellAlignment(row,column)
> CellAlignmentOffset(row,column)
> CellCheck(row,column)
> CellBold(row,column)
> CellItalic(row,column)
> CellUnderline(row,column)
> InvalidateCell(row,column)
>
> This is not the case for ColumnAlignment(column),
> ColumnAlignmentOffset(column), ColumnSortDirection(column), and, as you
> discovered: ColumnType(column).
>
> HTH, well...interesting issue anyway :-)
>
> Jack
>
>> for i= 0 to listbox1.listcount
>> for jto listbox1.columncount
>> listbox1.celltype(i,j)=Listbox.TypeEditable
>> next
>> next
>>
>> Thanks in advance,
>>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Listbox, cell(i,j).TypeEditable
Date: 31.01.05 23:55 (Mon, 31 Jan 2005 16:55:13 -0600)
From: Joseph J. Strout
At 11:43 PM +0100 1/31/05, Ronald Vogelaar wrote:

>How can I quickly set all cells in a listbox to TypeEditable? I tried the
>following, but it gave me an outofboundsexception:
>
> for ito listbox1.columncount
> listbox1.columntype(i)=Listbox.TypeEditable
> next

That's because you're going one column too far. If ColumnCount = 5,
then you have columns 0 through 4, not 0 through 5.

Best,
- Joe