Solved

MFC  , mdi forms

Posted on 2001-06-11
4
348 Views
Last Modified: 2013-11-20
can we place a combo box on mdi form,,, if not why
0
Comment
Question by:chilappak
  • 2
4 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 6177637
u mean on the main frame's toolbar or just on one of the child windows, or maybe on the view....?
0
 
LVL 3

Expert Comment

by:GlennDean
ID: 6179739
IF you want to put a combo box on the view in an MDI application, here's how to do that:
1.  Insert a new class called CMyComboBox, and have it inherit CComboBox
2.  In the view class, add a variable
   CMyComboBox m_CB
3.  In the view's OnInitialUpdate, go

void CMyView::OnInitialUpdate()
{
  CView::OnInitialUpdate();
     
  #define WS_STD    (WS_BORDER|WS_CHILD)
  #define WS_BUTTON (BS_DEFPUSHBUTTON|WS_CHILD)

  CRect rect(0,0,150,200);
  BOOL bCBCreated = m_CB.Create(WS_STD|CBS_DROPDOWN|WS_VSCROLL, rect,
this, IDC_VIEWCLASS_COMBOBOX);

  if (bCBCreated)
  {
    m_CB.ShowWindow(SW_SHOWNORMAL);
  }
}

  Glenn
0
 
LVL 3

Accepted Solution

by:
GlennDean earned 50 total points
ID: 6179773
Forgot to tell you what IDC_VIEWCLASS_COMBOBOX is.  
1.  Go into the Resource.h file and record the
_APS_NEXT_CONTROL_VALUE (in a default MDI app it should be 1000)
2.  Add the line
#define IDC_VIEWCLASS_COMBOBOX "the recorded value from step 1"

3.  Add 1 to the _APS_NEXT_CONTROL_VALUE

4.  The new Resource.h should look something like
#define IDD_ABOUTBOX                    100
#define IDR_MAINFRAME                    128
#define IDR_JUN112TYPE                    129
#define IDC_VIEWCLASS_COMBOBOX          1000

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS               1
#define _APS_NEXT_RESOURCE_VALUE     130
#define _APS_NEXT_CONTROL_VALUE          1001
#define _APS_NEXT_SYMED_VALUE          101
#define _APS_NEXT_COMMAND_VALUE          32771
#endif
#endif
0
 

Author Comment

by:chilappak
ID: 6184558
thank u . i am  a beginer in vc++
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Named range not carried over 10 63
conditional code and condition difference 9 82
tripleUp challenge 7 78
Making an alias 7 93
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 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