Listbox text change event


I use a listbox to show item description, qty, unit price, price(=unit price x qty), tax(=price x tax rate). I also add a textfield to sum up the subtotal of all items and sum up taxes and then the total price.

I hope each time I add a row to the listbox, the subtotal, taxes and total price will change accordingly. I’m using ListBox.CellTextChange event handler. But nothing fires. The documentation said,

[quote]Occurs after the KeyDown event if the KeyDown event returns False. Row and Column are zero-based.
The event passes the Row and Column of the cell being edited.[/quote]

Does it means if I change the cell by the codes, this event will not been triggered?

What’s the best meothd to detect an adding-row-by-code event?

PS: I also tried to use ListBox.Change, but it only triggered when everytime a programmatic change to ListBox.ListIndex. Besides that is there any other methods?


Its easier to add up at the point when you add a row.

[code]rollingtot = 0
for x as integer = 1 to numberofthing

listbox1.addrow “Sometext”
rollingtot = rollingtot + valueof stuff

textbox1.text = str(rollingtot)[/code]

The documentation states:

Str assumes that the period (.) is the decimal separator. If your application needs to recognize other decimal separators, use the CStr or Format functions.

So if you want to run your application on non US OS versions, you4d better use CStr or Format.

No link available for Str because the docs site is down (apparently) and the developer site does not know Str nor Str().
So I had to fire Xojo, open a project, open the language reference window and check there. Then I close everything. And I do not talk about Xojo IDE anti theft protections…