Solved

How to draw dropdown button in CFormview?

Posted on 2008-10-31
4
438 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
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand to include initial dialog with two choices. 9 86
maxBlock challenge 30 145
mapAB Challlenge 35 173
Way to decrease size of apk file 9 106
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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 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