Solved

How to draw dropdown button in CFormview?

Posted on 2008-10-31
4
428 Views
Last Modified: 2013-11-20
Hi,
How to draw dropdown button in CFormview?
0
Comment
Question by:srikadi
  • 2
4 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 250 total points
Comment Utility
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
Comment Utility
>>>> 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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 99
Error on moodle after upgrade 3 105
How to know only "File created" with EventLog 3 29
wordmultiple challenge 12 89
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 …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

9 Experts available now in Live!

Get 1:1 Help Now