|
-
Jan 19th, 2003, 06:14 PM
#1
Thread Starter
Frenzied Member
Listbox & Edit Box # Simple ?'s
How do i add text to a listbox in a MFC program and how do i get the selected Item from a listbox and also how do i get text from a edit control.
To summarize;
1: Add Char to listbox
2: Get Char from listbox
3: Get text or char from edit box
- JayWare
Live to love. Not to Hate
Im to busy to have a site. But I got one and still working on it.
http://dre3k.net/
-
Jan 20th, 2003, 04:46 AM
#2
1) CListBox::AddString, CListBox::InsertString
2) CListBox::GetCurSel, CListBox::GetSelCount, CListBox::GetSelItems, CListBox::GetSel
3) CEdit::GetWindowText
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 20th, 2003, 09:33 AM
#3
Thread Starter
Frenzied Member
what if i have 2 listboxes?
i tried
VB Code:
CListBox::AddString (buffer);
but ended up with a error
VB Code:
E:\Program Files\Microsoft Visual Studio\MyProjects\ClipboardT1\ClipboardT1Dlg.cpp(189) : error C2352: 'CListBox::AddString' : illegal call of non-static member function
- JayWare
Live to love. Not to Hate
Im to busy to have a site. But I got one and still working on it.
http://dre3k.net/
-
Jan 20th, 2003, 03:02 PM
#4
Thread Starter
Frenzied Member
OK now im trying to program in Win32 but i tried this and it dont work which means i did something wronge.
VB Code:
char *sBuf = "";
int iList;
iList = ::GetWindowTextLength(list);
::GetWindowText(list,sBuf,iList);
::SetWindowText(edit,sBuf);
What im trying to do is obvious (lol if i could spell it ) Im trying to get the selected item in the listbox to goto a edit box.
- JayWare
Live to love. Not to Hate
Im to busy to have a site. But I got one and still working on it.
http://dre3k.net/
-
Jan 21st, 2003, 11:19 AM
#5
I meant to call these functions. Of course, since they're methods, you need an instance of those classes.
Code:
CListBox lb1, lb2;
// ...
lb1.AddString("Hello");
lb2.AddString("Hi");
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 21st, 2003, 01:18 PM
#6
Thread Starter
Frenzied Member
- JayWare
Live to love. Not to Hate
Im to busy to have a site. But I got one and still working on it.
http://dre3k.net/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|