David Schwartz 426 Posted July 24, 2021 It seems like the only list-type control that gives you the option of showing lines is TListView. Is there a simple way of adding grid lines to other common list controls, like TListBox? (I don't do much with custom drawing stuff.) Share this post Link to post
David Schwartz 426 Posted July 24, 2021 31 minutes ago, dummzeuch said: What about TStringGrid / TDrawGrid? A listbox is really easy to use. A stringgrid is not a simple replacement for a listbox. Share this post Link to post
dummzeuch 1505 Posted July 24, 2021 I don't really see much of a difference between using a listbox and using a one column string grid. Share this post Link to post
David Schwartz 426 Posted July 24, 2021 I'm asking about how to add lines to list-like controls. TListView has a checkbox. TListBox has nothing. A lot of other libraries have simlar types of list controls and none of them offer lines either. I'm just curious how one would go about doing that. Saying "use something else" isn't addressing the question, but it may be an option in some circumstances. Share this post Link to post
Anders Melander 1783 Posted July 24, 2021 Since you don't want to hear about alternatives the only solution you have is owner drawing the listbox. A Google search would have given you that answer and it would also give you examples of how to do it. Start here: https://docs.microsoft.com/en-us/windows/win32/controls/about-list-boxes ...or simply use a TListView. Share this post Link to post
David Heffernan 2345 Posted July 25, 2021 Use a list view. Part of problem solving is exploring the problem space and finding the best solution, given the pros and cons of all possible options. Deciding on the solution first and then trying to force it to work is not the way to solve problems. 1 Share this post Link to post