Solved

List boxes in dialog boxes

Posted on 1998-12-07
3
157 Views
Last Modified: 2010-04-16
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.
0
Comment
Question by:pobwest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 1216371
Hi, it's that Rat again.
The long way round is to send the control a message LB_ADDSTRING
with SendDlgItemMessage :-
    SendDlgItemMessage(hDlg,IDD_LISTBOX,LB_ADDSTRING,0,
                   LongInt(Pchar(@CharArray)));
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;
    ListBox:=New(PListBox,InitResource(@self,IDD_LISTBOX));

The InitResource constructor takes the TDialog object (here as self) and the ID of the box. You can now call the AddString method :-
    ListBox^.AddString(String);
OK? or do you want further details?
0
 

Author Comment

by:pobwest
ID: 1216372
Thanks, thats what i was looking for.
0
 
LVL 27

Accepted Solution

by:
BigRat earned 50 total points
ID: 1216373
Then I'll answer the other one then.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question