Solved

MFC  , mdi forms

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
GIF file bit manipulation for color change 5 104
Define unique primary key 9 81
WinWaitActive parameters 12 31
Problem to open Excel file 15 38
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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 discusses moving either the default database or any database to a new volume.

707 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

15 Experts available now in Live!

Get 1:1 Help Now