Solved

Dialog Menu SetCheck Problem

Posted on 1998-11-11
3
799 Views
Last Modified: 2013-11-20
Is there a way to make the SetCheck() and Enable() functions work with dialog application menus? And if so, how?  I can get SetCheck to work with SDI applications.  Using the UPDATE COMMAND UI choice to make a function.  With a dialog appliction, it does not work!  The function is being called, I checked it with a MessageBox from inside the funtion.  I'm using VC++ 6.0.
0
Comment
Question by:gregga
3 Comments
 
LVL 1

Expert Comment

by:Grailman
ID: 1324512
GetDlgItem(MY_DLG_ITEM)->EnableWindow(FALSE);
GetDlgItem(MY_DLG_ITEM)->EnableWindow(TRUE);
GetDlgItem(MY_DLG_ITEM)->SetCheck(FALSE);
GetDlgItem(MY_DLG_ITEM)->SetCheck(TRUE);
0
 

Author Comment

by:gregga
ID: 1324513
This may work with control buttons but does not work with menus on dialog boxes.
0
 
LVL 2

Accepted Solution

by:
cyrilbdt earned 100 total points
ID: 1324514
BOOL CAboutDlg::OnInitDialog()
{
      CDialog::OnInitDialog();
      CMenu* pMenu = GetMenu();
      pMenu->EnableMenuItem(ID_XX, MF_BYCOMMAND|MF_GRAYED);
      pMenu->CheckMenuItem(ID_YY|MF_BYCOMMAND, MF_UNCHECKED);
      return TRUE;
}

this work just fine
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question