List Box(simple Question)
-
How do you add items to a list box??? I have created a dialog in my app and added a list box to it but I have no idea how to add items to it! Thanks in advance. Paddy.
Call the AddString() method. Dave
-
Call the AddString() method. Dave
Thanks, The problem I'm actually having is that I don't know how to reference the listbox that I have created with the dialog editor. For example: CListBox* myList; myList->AddString( str ); Do you know What code I need to use so that myList refers to the listbox that I have created in ID_MYDIALOG? Does this make sense? Thanks in advance
-
Thanks, The problem I'm actually having is that I don't know how to reference the listbox that I have created with the dialog editor. For example: CListBox* myList; myList->AddString( str ); Do you know What code I need to use so that myList refers to the listbox that I have created in ID_MYDIALOG? Does this make sense? Thanks in advance
Take a look at this article about creating control variables: http://www.codeproject.com/cpp/nogetdlgitem.asp Dave
-
How do you add items to a list box??? I have created a dialog in my app and added a list box to it but I have no idea how to add items to it! Thanks in advance. Paddy.
Call AddString() method; For example: myListBox.AddString("Hello!:");
-
Take a look at this article about creating control variables: http://www.codeproject.com/cpp/nogetdlgitem.asp Dave
Thanks Dave, For some reason I can't add any member variables, the "variables" menu item is grayed out when I right click on a control in the dialog editor! It's ok coz I found an easier way of doing it using:
SendDlgItemMessage(hDlg, ID_MYLIST, LB_ADDSTRING, 0, (LPARAM)"Hi there!");
Thanks for the help, Paddy.