Solved

How to draw dropdown button in CFormview?

Posted on 2008-10-31
4
445 Views
Last Modified: 2013-11-20
Hi,
How to draw dropdown button in CFormview?
0
Comment
Question by:srikadi
[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 49

Accepted Solution

by:
DanRollins earned 250 total points
ID: 22855716
Please see:
    A Basic Chooser-Style DropDown ToolBar Button
    http://www.codeproject.com/KB/menus/ToolBarDropdown.aspx
and
   Using Drop-Down Buttons in a Toolbar Control  
   http://msdn.microsoft.com/en-us/library/1ke6s1fc(VS.80).aspx
0
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 250 total points
ID: 22855991
>>>> How to draw dropdown button in CFormview?
The style TBSTYLE_EX_DRAWDDARROWS was needed for that. It was available with MFC 5.80 that came with VC7 (2002/2003).

So for VC6 (released 1998) you can't use these button styles but could try to make it your self.

You could

- create a bitmap button (or an owner-draw button)
- add a handler which opens a menu placed below the button (same as would open a menu on right-clicking in a list)

Of course it would take some time to get a suitable quality and behavior for your self-made control but it may be worth the efforts ;-)

 
0
 

Author Comment

by:srikadi
ID: 22892458
Hi,
could you tell me how to create owner draw button?..what are the steps i need to do..
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 22892923
You need to choose the owner draw style for the button in the resource editor. Then you have to provide a member of the button (use the wizard). Derive a new class from CButton and change the type of the dialog member button to the new class type. The DoDataExchange then will make the subclassing for the button. Finally override the CButton::DrawItem (you must override it) which will be called whenever the button must be drawn.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 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