On Feb 08, 2007, at 11:42 PM, Robert Livingston wrote:

Mac OSX.4

REALBasic 2007r1


I have a listbox. I also have an edit field.

What I want to happen is that the edit field takes on a particular value in its text property when the user clicks on a line in the listbox.


1. User clicks on listbox1

2. The cell click event occurs

3. the EditField1.Text is assigned a string value in the code of the listbox1.CellClick

4. Nothing shows up in the EditField.

5. User clicks AGAIN in the listbox1 (different row)

6. NOW the EditField1.Text shows up in the EditField but it is the text that was SUPPOSED to show up after the click on the original row, not the row that was most recently clicked.


Not sure what your code looks like but it should work as you describe

I set one up really quick and put an editfield and a 2 column listbox on a window
In the open event of the listbox I put

  me.AddRow ""
  me.Cell(me.LastIndex,-1) = "1" + chr(9) + "a"
  me.AddRow ""
  me.Cell(me.LastIndex,-1) = "2" + chr(9) + "b"
  me.AddRow ""
  me.Cell(me.LastIndex,-1) = "3" + chr(9) + "c"
  me.AddRow ""
  me.Cell(me.LastIndex,-1) = "4" + chr(9) + "d"
  me.AddRow ""
  me.Cell(me.LastIndex,-1) = "5" + chr(9) + "e"

In the cellcick event I put

  EditField1.text = ""
  if row < 0 or row >= me.ListCount then return false
  EditField1.text = me.Cell(row,column)
  return true

and every time I click I get the data in the row & column clicked in the editfield

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

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

Reply via email to