• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

List boxes in dialog boxes

In TPW 1.5 I need to know how to put data (ie null strings) into list boxes which are in dialog boxes made in the resource workshop. I have tried setdlgitemtext with no luck, and the addstring command is a mystery. Thanks.
  • 2
1 Solution
Hi, it's that Rat again.
The long way round is to send the control a message LB_ADDSTRING
with SendDlgItemMessage :-
and that for each string (which here is in CharArray). The Message is LB_ADDSTRING, the wParam is zero and the lParam is the address of the string.

The AddString method to which you refer is when you have a TListBox *object*. You can create one of these with New
in a TDialog derivitive :-
    ListBox : PListBox;

The InitResource constructor takes the TDialog object (here as self) and the ID of the box. You can now call the AddString method :-
OK? or do you want further details?
pobwestAuthor Commented:
Thanks, thats what i was looking for.
Then I'll answer the other one then.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now