Listbox Row, Adjust? (1 Viewer)

GUIDO22

Registered User.
Local time
Today, 13:41
Joined
Nov 2, 2003
Messages
515
I don't suppose the ROWS in a listbox control can be adjusted i have multiline text i need to display.
If not i suspect the only way around this is to use continuous form display config with a multiline text box ..
 

isladogs

MVP / VIP
Local time
Today, 13:41
Joined
Jan 14, 2017
Messages
18,130
Suggest you use a subform instead of a listbox.
 

SHANEMAC51

Active member
Local time
Today, 16:41
Joined
Jan 28, 2022
Messages
310
Code:
SELECT W.ZID, W.ZTEXT_LIST
FROM (SELECT tblDTO.[zID], MID(tblDTO.[ztext],1,30) AS ZTEXT_LIST,ZTEXT & "_1" AS ZTEXT_SORT
FROM tblDTO
UNION ALL SELECT tblDTO.[zID], "~~~" &MID(tblDTO.[ztext],31,30),ZTEXT & "_2"
FROM tblDTO WHERE LEN(ZTEXT)>20
UNION ALL SELECT tblDTO.[zID], "~~~" &MID(tblDTO.[ztext],61,30),ZTEXT & "_3"
FROM tblDTO WHERE LEN(ZTEXT)>20
ORDER BY 3)  AS W;
 

Attachments

  • Screenshot_10.png
    Screenshot_10.png
    25 KB · Views: 118

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:41
Joined
May 21, 2018
Messages
8,417

There is a class in there to wrap any listbox regardless of list width. There are two versions. You pretty much need a temp table if you want the wrap to be indented with a space.
 

isladogs

MVP / VIP
Local time
Today, 13:41
Joined
Jan 14, 2017
Messages
18,130
@MajP
I'd not seen that example before and its very clever.
At first sight it does appear to split the listbox items into more than one line
...but of course the multiple lines are generated by splitting the items themselves, each of which can then be selected separately.

I think that @SHANEMAC51 was showing the same idea

So to my mind, it's this is still not achieving the OP's requirements which I believe is having the same listbox item on more than one row...which AFAIK cannot be done
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:41
Joined
May 21, 2018
Messages
8,417
@isladogs, yes AFAIK there is no such control. Maybe a third party exists. FYI i used your code to determine the width of the string based on the font. It is a pretty good fake.
 

isladogs

MVP / VIP
Local time
Today, 13:41
Joined
Jan 14, 2017
Messages
18,130
Glad to see it being used. Wizhook rules ...👍
 

Users who are viewing this thread

Top Bottom