Desktop project on Windows 10
I want to show the right-most characters of a column in a list box. Right-justify works as expected when the column is wide enough to contain all the test. But when the column is too narrow, I want to see the right-most characters. Setting the column or cell to right justified doesn’t do this - when the data exceeds the space it shows the left-most characters that will fit.
Works the same way with ListBox and DesktopListBox. Bug with right justify, or supposed to work this way? Another way to do this? Thanks.
using the celltextpaint event you can display whatever you want in a listbox cell.
Or, I believe you can use the ActiveTextControl property and set its alignment property.
Thanks Jean-Yves and James for the suggestions. On further thought, the reason I want to see the right-most characters is because all the strings begin the same. They’re URLs for images, so they all begin https://mydomain.com/images/. Better architecture is to store the URL separately from the file name. This allows storing images in different folders if we get too many to keep in a single folder. And the relevant part is really the file name, so I’ll just show that in the list box.
Still not sure if right-justify is doing the right thing, but doesn’t matter at this point for this app.
9 posts were split to a new topic: ListBox.ActiveTextControl Alignment