a view as a listbox

Hi everybody!
it´s possible to have a view as a listbox, ie. a listbox embedded in a view. I tried with a formview with a listbox, but it does not like me very much.

is there another way to do it?
I´ll apprecaite any help
jespadasAsked:
Who is Participating?
 
Answers2000Connect With a Mentor Commented:
I don't have VC1.5 anymore, but this should work

i. Override PreCreateWindow.  Create the window a Listbox with class name of "listbox" and style as you want.

2. When-ever you want to call list box functionality you can cast the CView pointer into a CListBox pointer

e.g. in CView

((CListBox *)this)->AddString( "Hello" ) ;

This cast will work because the CListBox class includes no additional data members beyond those in CWnd, and neither does your view.  Adding data members to the view should be okay, adding to the list box class (or a derived class of CListBox) is _not_.
0
 
jespadasAuthor Commented:
Edited text of question
0
 
jespadasAuthor Commented:
Edited text of question
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Andy_KeysCommented:
I done a formview iwth a list box, why does it not like you. If you post some code or give some reason "we" might be able to help
0
 
ambyCommented:
tried CListView ???
0
 
jespadasAuthor Commented:
I am sorry! I didn´t tell you guys. I am doing it on VC 1.5x, as you know I don´t have this great controls

0
 
jespadasAuthor Commented:
I don´t have this great controls on VC 1.5x
0
 
jespadasAuthor Commented:
Andy,

Formview works fine, but I Don´t like because I need to resize the control to fits on my view. I would like get it on a easy way like ListView on VC 32 bit version.
If I have no choice I am going to used...

thanks!!!


0
 
jespadasAuthor Commented:
Thank you!
Sorry for accept until now :¬)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.