Solved

MFC  , mdi forms

Posted on 2001-06-11
4
350 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
format the code in java 6 117
Change to event 1 138
Trying to run powershell  in a batch file. How do I do this? 8 124
moto 4g phone enable finger print 4 74
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

752 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