roadbeer69
Programmer
Hi All,
I've two questions related to TListBox that I've been unable to find the answer to. I'm hoping someone here can help.
Backgroud: My app has a TListBox into which users can add strings by using a TEditBox.
Questions:
1. I'd like to have the strings in the TListBox separated by some sort of line, sort of like a grid. I have been unable to figure out how to do this. Is this even possible? If so, how? If not, is there another control that will do what I want? I've looked at the TStringGrid object, but that seems a bit heavy-weight for what I want to do.
2. When a user enters a string that is too wide to be displayed in the TListBox, I'd like to set the TLIstBox's ScrollWidth property such that the horizontal scroll bar has enough travel to display the string. Further, if a longer string is added, I'd like to be able to increase the length of the scroll bar. My problem is that ScrollWidth is in pixels. Is there an easy way to determine the width of a string in the TListBox in pixels so that I can set the ScrollWidth property?
Thanks very much in advance!
Jeff
I've two questions related to TListBox that I've been unable to find the answer to. I'm hoping someone here can help.
Backgroud: My app has a TListBox into which users can add strings by using a TEditBox.
Questions:
1. I'd like to have the strings in the TListBox separated by some sort of line, sort of like a grid. I have been unable to figure out how to do this. Is this even possible? If so, how? If not, is there another control that will do what I want? I've looked at the TStringGrid object, but that seems a bit heavy-weight for what I want to do.
2. When a user enters a string that is too wide to be displayed in the TListBox, I'd like to set the TLIstBox's ScrollWidth property such that the horizontal scroll bar has enough travel to display the string. Further, if a longer string is added, I'd like to be able to increase the length of the scroll bar. My problem is that ScrollWidth is in pixels. Is there an easy way to determine the width of a string in the TListBox in pixels so that I can set the ScrollWidth property?
Thanks very much in advance!
Jeff