Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Displaying Drop down List in CComboBox

Posted on 2003-11-17
1
Medium Priority
?
269 Views
Last Modified: 2013-11-20
Hi
I have been trying to get a CComboBox with a Drop-List to show fonts. I think Ive done everything right but I still cant seem to see a full-drop down list. I get a very small list with 2 buttons for scrolling up and down and i can view only one of the items and not all.
Note that I also do FontComboBox.ShowDropDown(TRUE);

Please help !!

I created the combobox using the Resource View tab in Visual Studio.
The code in my OnInitDialog() is as show below:

BOOL ConfigDialog::OnInitDialog()
{
      //Load the fonts
      InstalledFontCollection *installedFontCollection =
            new InstalledFontCollection();

      // Get the count of FontFamily objects.
      int count = installedFontCollection->GetFamilyCount();
      cout<<"installedFontCollection :"<<count<<endl;

      FontFamily *fontFamilies ;
      FontFamily *loopFamilies ;
      fontFamilies = new FontFamily[count];

      int temp = 0;
      installedFontCollection->GetFamilies( count,fontFamilies,&temp );

      loopFamilies = fontFamilies;
      // loop and get all font family names.
      for(int j = 0; j < count; ++j)
      {
            WCHAR  familyName[LF_FACESIZE];
            cout<<"FamilyName::"<<familyName<<endl;
            loopFamilies->GetFamilyName(familyName,LANG_NEUTRAL);  
            CString name(familyName);
            cout<<"Name::"<<name<<endl;
            FontComboBox.AddString(name);
            loopFamilies++;
      }
      cout<<"No of items :"<<FontComboBox.GetCount()<<endl;

      FontComboBox.ShowDropDown(TRUE);

      return TRUE;  // return TRUE  unless you set the focus to a control
}

-P
0
Comment
Question by:prakash_gs
[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
1 Comment
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 375 total points
ID: 9769515
You can modify that in the Dialog resource itself

1. Place the Combo in dialog resource, so the selection will be in that control
2. Click on the drop arrow of the combo
3. Now you can see the selection has changed a little bit
4. Now Increase its hight by dragging the selection handle

Good Luck
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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: 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 …
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.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

705 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