IT Community - Software Programming, Web Development and Technical Support

How to add items in to List Box in VC++ win32 applications?

This is a discussion on How to add items in to List Box in VC++ win32 applications? within the C and C++ Programming forums, part of the Software Development category; How to add items in to List Box in VC++ win32 applications?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-30-2007, 12:48 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Question How to add items in to List Box in VC++ win32 applications?

How to add items in to List Box in VC++ win32 applications?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-30-2007, 12:56 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: How to add items in to List Box in VC++ win32 applications?

We can add the items in to List Box in VC++ win32 applications using the following notification message.

int index = SendDlgItemMessage(hwnd, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)"Hi there!");

As you can see, this is a pretty simple task. If the list box has the LBS_SORT style, the new item will be added in alphabetical order; otherwise it will just be added to the end of the list.

This message returns the index of the new item either way, and we can use this to perform other tasks on the item, such as associating some data with it. Usually this will be things like a pointer to a struct containing more information, or maybe an ID that you will use to identify the item, it's up to you.
__________________
The OXYGEN
Delivers edgy, intelligent Technology to all...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to populate items to Drop downlist without postback? KiruthikaSambandam ASP and ASP.NET Programming 4 10-11-2008 08:39 PM
How to add items to dropdown list using javascript Sundaram HTML, CSS and Javascript Coding Techniques 2 02-25-2008 07:19 AM
Desktop items when logging in pcguy Operating Systems 0 07-31-2007 07:35 PM
Search the items with more accurate in Google Jeyaseelansarc Google 0 05-22-2007 10:52 PM
List Items in Testplan stephen Software Testing 1 05-16-2007 05:58 AM


All times are GMT -7. The time now is 05:47 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0