Solved

How to draw dropdown button in CFormview?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

862 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

29 Experts available now in Live!

Get 1:1 Help Now