Adding data to a existing line in a list box

Post

Posted
Rating:
#1 (In Topic #913)
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 Hi all,

Can some one please point me in the correct direction

I want to know how can I add another line of text to an existing line with in a list box?

Example

I have in my list box

Value orange juice £0.50

I want to apply a 50% discount so when I do it should look like this in the list box

Value orange juice £0.50
Discount                -£0.25

So the whole line is selected with the blue high lighter


Or do I have to remove the line completely and re add both lines?
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
 I'm pretty sure a listview won't use varying line sizes

But a gridview will for sure
You can set gridview.rows[iIndex].Height = gridview.font.height * 2 or something
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’

BruceSteers said

I'm pretty sure a listview won't use varying line sizes

But a gridview will for sure
You can set gridview.rows[iIndex].Height = gridview.font.height * 2 or something

I could be wrong

Did you try …

Listview1[iIndex].Text &= "/nDiscount -£0.25"
Online now: No Back to the top

Post

Posted
Rating:
#4
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
I managed to get it to work thanks

I used

Code

Dim he as gridview
Dim b as byte

B  = lstcurrent.list.max

Listcurrent[b].text = gb.crlf & "Discount"

gw = lstcurrent.children[0]

gw.rows[b].height = -1

Listcurrent.refresh
Online now: No Back to the top

Post

Posted
Rating:
#5
Guru
BruceSteers is in the usergroup ‘Guru’
I found it just works as expected putting in a new line in a listbox as normal, no need to set any sizes it's handled automatically.
(sorry i was at work last night so was guessing)
I tried it today…

Listcurrent.text &= "\nDiscount"

should be all you need :)
Online now: No Back to the top
1 guest and 0 members have just viewed this.