abcdefgqwerty2

MFC is confusing me. I added a string variable to a listbox control. Then in a seperate class I am handling the selectedindex event so I can get the index from that listbox control. How can I get the text of the item that they select
MFC seems to be more complicated that needed. The hardest part is figuring out how on earth to access variables that are scattered about in different classes. Im not even sure if i asked my question right.


Re: Visual C++ General MFC beginner question on controls

Alex Farber

It is more convenient to work with listbox using control variable of type CListBox. When you add variable using MFC Wizard, select Control type. Having CListBox variable, you can use GetCurSel to get selected index, and GetText to read listbox item.



Re: Visual C++ General MFC beginner question on controls

Bite Qiu - MSFT

hello

Re: MFC beginner question on controls

such questions are out of scope of this forum, for the scope of visual c++ general forum, look at:http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=19445&SiteID=1

the more appropriate place for your question is probably the mfc newsgroup:http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.vc.mfc&lang=en&cr=US

thanks

bite






Re: Visual C++ General MFC beginner question on controls

abcdefgqwerty2

Ah ok thanks.