Solved

List boxes in dialog boxes

Posted on 1998-12-07
3
160 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
Learn why we support net neutrality and why the topic is important to all internet users.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

717 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