ComboBox List TextWrap

  1. 4 months ago

    Aurelian N

    Jul 11 Pre-Release Testers, Xojo Pro

    Is there a simple way to wrap the text on a ComboBox list ? so far we do have some lines that are longer than the list and the text get cut with those ... and because of similar data between the lines it is hard to select the correct line, usually the last word changes but because of the list limit it does not show

    Thanks .

  2. Aurelian N

    Jul 11 Pre-Release Testers, Xojo Pro

    Is there a way to wrap the text ? for example I get the text length and then the control width and if bigger I split in in parts, but the question is how do I split it ?based on what ?

  3. Bob K

    Jul 11 Pre-Release Testers, Xojo Pro Kansas City

    No way that I know of. You can always create your own “list” by using the mouse down event and “pop up” a window containing a list box that can handle the multiple line drawing. Not trivial, mind you, but a way that I might approach it.

  4. Tanner L

    is not verified Jul 11 Pre-Release Testers Toronto, Canada

    You could try using a monospace font for that particular combobox. Test what your combobox can hold, and then split the strings before that point.

    Maybe not the nicest looking, but with a font like IBM's Plex Mono it could be passable.

  5. Sam R

    Jul 11 Pre-Release Testers, Xojo Pro Hengchun, Pingtung, Taiwan

    I'll start by saying, that in theory it's possible with some hacking as the Combo box contains a NSTextFieldCell, however I'll stop you there and say that it's probably not a good idea as the ComboBox is also a weird control and does many things that are not standard with other controls.

    I would suggest you consider making your own, with a textfield and a popup menu or triangle.

  6. Maximilian T

    Jul 12 Pre-Release Testers, Xojo Pro Europe, Germany, Berlin
    Edited 4 months ago

    Can't you just tuck the complete string into the rowtag and then ask for it?

or Sign Up to reply!