![]() This is displayed in the third image above, and can be obtained with code like the following (notice #9 is the tab character): By pressing the button again, you get more content with a horizontal scrollbar (second image).Īnother completely different approach, is to set the TabWidth property to obtain a list box in which individual lines can be displayed in columns, as long as they use tabs in their text. ![]() If you press the button once (with the control size in the first image below) it fills the first two columns and part of the third. For this, you use the Columns property and the VCL will make the width of each colum equal to the width of the control divided by the number of columns. The list box still have a list of strings, once at the end of the available space, rather than scrolling vertically the data is added to a new colum and possibly scrolled horizontally if it doesn't fit. The first option is building a list box with content flowing on multiple columns. The bad news is documentation is not that precise and even long time Delphi developers might not know how to achieve this. ![]() The good news is that the VCL TListBox control wraps these features making them easy to use. These are made available using specific styles when creating the control, and specific Windows messages (like LB_SETCOLUMNWIDTH and LB_SETTABSTOP) to pass data. Since early versions of Windows, the operating system offers some special configurations to allow multi-column list boxes. They can have associated data, but that's a separate topic. ![]() The Windows List box control (one of the primitive and classic user.dll controls) generally displays a single list of strings. I did a quick Google search and didn't find a quick answer, but rather many incorrect and old ones. This one was triggered by a Quality Portal report, which refers to an imprecise (but not fully incorrect) page of the RAD Studio Doc Wiki - same works in C++Builder. I might be starting a new series of blog posts, going back to classic tips. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |