# How to handle 'change' event of listbox

**URL:** <https://forum.xojo.com/t/how-to-handle-change-event-of-listbox/29580>\
**Category:** General\
**Created:** [February 5, 2016, 10:21am UTC](https://forum.xojo.com/t/how-to-handle-change-event-of-listbox/29580 "2016-02-05T10:21:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![changwon\_lee](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@changwon\_lee](https://forum.xojo.com/u/changwon_lee)\
**Post date:** [February 5, 2016, 10:21am UTC](https://forum.xojo.com/t/how-to-handle-change-event-of-listbox/29580/1 "2016-02-05T10:21:53Z")

</div>

There is a listbox having several rows, and I am trying to display the value of the specific column into textarea as a user moves keyboard(arrow) or mouse click on the row.  
For this requirement, I use ‘change’ event of listbox.  
It works well except one thing.

When I click other row in listbox, actually it is empty row, column values of all of rows are displayed in textarea.

```auto
statementArea.text = Me.Cell(Me.listindex,12)
```

Do you know what is wrong?

---

<div class="post-metadata">

**Author:** ![Roger\_Clary](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/eada6e/32.png) [@Roger\_Clary](https://forum.xojo.com/u/Roger_Clary)\
**Post date:** [February 5, 2016, 11:26am UTC](https://forum.xojo.com/t/how-to-handle-change-event-of-listbox/29580/2 "2016-02-05T11:26:45Z")

</div>

If me.ListIndex \<\> -1 Then  
statementArea.text = Me.Cell(Me.listindex,12)  
Else  
StatementArea.text = “”  
End If

---

<div class="post-metadata">

**Author:** ![changwon\_lee](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@changwon\_lee](https://forum.xojo.com/u/changwon_lee)\
**Post date:** [February 5, 2016, 11:35am UTC](https://forum.xojo.com/t/how-to-handle-change-event-of-listbox/29580/3 "2016-02-05T11:35:29Z")

</div>

Ah… -1  
I learned that.

It works well. Thank you so much.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [February 5, 2016, 12:01pm UTC](https://forum.xojo.com/t/how-to-handle-change-event-of-listbox/29580/4 "2016-02-05T12:01:52Z")

</div>

If you allow multiple Row selection, it appears to me that the first (from the top, the lower Row # value) Row contents is displayed.

I do not care, but you may.

PS: I love to get that Row contents replication (even if I let the Tab value in the TextField).

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:10pm UTC](https://forum.xojo.com/t/how-to-handle-change-event-of-listbox/29580/5 "2020-10-29T18:10:43Z")

</div>


