On Dec 27, 2005, at 8:05 AM, Chuck Pelto wrote:

Is this possible? And how can I change the text in a listbox cell without going through the system in the examples?



Yes. Write code in CellKeyDown to identify navigation keys and use EditCell. The snippet below is an example of the type of code that might be used, perhaps in a subclass of listbox. It was for a two column box.

If key = chr(9) or key = chr(29) or key = chr(13) then 'tab key, right arrow, return
    'move to next available entry cell
    If column + 1 <= me.columnCount - 1 then 'tab to next column
      me.editCell row,column + 1
Elseif row + 1 <= me.listcount - 1 then 'currently in last column, not about to exit
      if column - 1 >= 0 then  'not in column 0 (must be in column 1)
        If me.Cell(Row, 0) <> "" then 'if a variable name is entered
          If me.Cell(Row,1) = "" then 'but no value, then
            beep
            msgBox "Please enter a value or delete the variable."
            me.EditCell Row, 1
          Else
me.editCell row+1, column - 1 'advance one row, to column 0
          End if
        Else
me.editCell row + 1, column - 1 'advance one row, to column 0
        End if
      End if
Elseif row + 1 > me.listcount - 1 then 'attempting to exit list, so go back to start
      me.editCell StartEditableRow,0
    End if
    return true
  End if

With regard to the second part of your question, I don't know what you mean by going through the system in the examples.

Best,

Jack
_______________________________________________
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>

Reply via email to