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.
Printable View
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.
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.
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.