Listbox Row, Adjust?

GUIDO22

Registered User.
Local time
Today, 10:51
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 ..
 
Suggest you use a subform instead of a listbox.
 
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: 149

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.
 
@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
 
@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.
 

Users who are viewing this thread

Back
Top Bottom