Hey I have to make this quick cause I have to leave pretty soon.
So I was wondering if there is any way to add a char to a listbox control, I tried SendMessage but it doesn't work
thanks in advance.
Hey I have to make this quick cause I have to leave pretty soon.
So I was wondering if there is any way to add a char to a listbox control, I tried SendMessage but it doesn't work
thanks in advance.
Posting an example of what you're doing, and what you tried would be better.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
It's not possible. Listboxes are designed to just sit there displaying nothing.
EDIT: To be less sarcastic, you might start by explaining what you mean by "adding a char" to a listbox.
Last edited by brewbuck; 07-06-2010 at 11:11 PM.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
Hey I have to make this quick cause I have to leave pretty soon.
If you can set aside the time to do a Google (or your favorite search engine) search you'd find many, many results. Any basic tutorial using listboxes in whatever language you are using would have this info.
this is what I am trying
And please don't be a hater just because I said I have to make this quick.Code:hwndlistbox = CreateWindow(TEXT("Listbox"), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_MULTILINE, 50, 70, 170, 140, hwnd, (HMENU) ID_EDIT, NULL, NULL); char buff1[50]; pfile = fopen("C:\\reminder\\data\\backup1.xls", "r"); while(fgets(buff1,50, pfile)) { SendMessage(hwndlistbox, LB_ADDSTRING, 0, (LPARAM)buff1); }
In the CreateWindow for the listbox : Take off the ES_MULTILINE style. Add in LBS_STANDARD style.
Edit : Also remove WS_BORDER, as it is added with LBS_STANDARD.
Edit 2 : If you had taken the time to post that snippet of code first, your solution could have been found sooner.
Last edited by DaveH; 07-07-2010 at 12:00 PM.