Print Page | Close Window

CDialog/Toolbar/Menu Problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: General Discussion
Forum Description: Topics Related to Visual C++ MFC Development in General
URL: http://forum.codejock.com/forum_posts.asp?TID=419
Printed Date: 12 May 2024 at 11:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CDialog/Toolbar/Menu Problem
Posted By: JamesC
Subject: CDialog/Toolbar/Menu Problem
Date Posted: 05 February 2004 at 12:44pm
I have a CDialog and I attached a toolbar and a menu to the Dialog. Both show up and everything looks good but nothing gets highlighted when I mouse over an item. In regards to the menu, when I click the menu, items do pop up and do respond to mouse clicks. In regards to the toolbar, tooltips do work when I mouse over an item and the toolbar does respond when I click on an item BUT the toolbar item remains highlighted from that point forward? I compared my code to that of the DialogSample and I can't see any difference. Any ideas? This is happening on ALL of my dialogs that contain a menu and/or toolbar. Mainframe works fine though. Problem is just on dialogs.



Replies:
Posted By: JamesC
Date Posted: 05 February 2004 at 12:47pm
Also my dialog is resizable and even though both the toolbar and the menu have the flag xtpFlagStretched set they do not draw to the end when I resize the dialog. At first the dialog looks good but if you resize the dialog to anything larger then the created size, you can see the bk color of the dialog.


Posted By: JamesC
Date Posted: 05 February 2004 at 1:32pm
Ok. I figured out the OnKickIdle part that I seemed to have forgotten which fixed the highlighting issue on some of the dialogs but on others they are still messed up. The resizing issue is still there.


Posted By: krulle
Date Posted: 10 November 2004 at 4:39am

For solving the sizing issue, overload the OnSize event. Something like this should work:

void CMyDlg::OnSize(UINT nType, int cx, int cy)  {

    CDialog::OnSize(nType, cx, cy);

    RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);

}




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net