Solved

Dialog Menu SetCheck Problem

Posted on 1998-11-11
3
794 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now