Solved

MFC  , mdi forms

Posted on 2001-06-11
4
352 Views
Last Modified: 2013-11-20
can we place a combo box on mdi form,,, if not why
0
Comment
Question by:chilappak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

635 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