Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show 2 CListCtrl in one CControlBar

Status
Not open for further replies.

xzhang

Programmer
Jun 7, 2001
9
0
0
US
Hi,

Is it possible to create 2 CListCtrl in a CControlBar?

Thanks.

Xiaoming
 
sure you can. If more help is needed, make your question more specific.
 
Hi, Jeffery:

My goal is to have one CControlBar-derived class object which shows two objects of CListCtrl derived classes in the CMDIFrameWnd of my application. One CListCtrl object will be at the left and the other CListCtrl object will be at the right of client area of the CContrlBar object. I also like to able to move the border line between the two CListCtrl object so that I can change the viewing width of them. For exmple, if I move CListCtrl's border line to the right, the width of left CListCtrl will increase while the width of right CListCtrl will decrease. In this way, I could get similar result as that of CSplitterWnd although a CSplitterWnd object is not used.

The reason why I don't want to use CSplitterWnd is because I already have a CSplitterWnd in the CMDIFrameWnd and I don't want to show both the CSplitterWnd and the CCtontrolBar at the same time.

I guess my problem is how to put two CListCtrl objects into one CControlBar. What is the code inside of OnCreate() of CControlBar object to show two CListCtrls objects? What are the size parameters of CListCtrls?


Thanks in advance for your help.

Xiaoming
 
Well, I suggest you use CDialogBar. You can create a dialog resource in the resource editor of vc IDE and put your two listCtrl into your dialog resource. Then associate your resource ID of the dialog to your CDialogBar class. Try to create the CDialogbar in your mainframe and dock it to your frame window. that's it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top