DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Robert Guest

    OnDraw and Windows MFC controls


    Hi,

    I am having a small problem, and I don't know if this is even possible.
    I am writing an application that uses a custom UI I designed that is displayed
    in a CFormView using the OnDraw function. It has drop down menus that are
    displayed when the mouse rolls over areas of the UI, much like some webpage
    have roll over drop down menus.

    This is all working, but I have encountered a problem. I want to use the
    stock controls (buttons, edit boxes, list boxes and etc.) in the rest of
    the form. I want my drop down menus to be "drawn over" these controls.
    But this is not the case. The controls are drawn on top of any drawing code
    that I have done. Its as if my drawing code from the OnDraw function is
    no more than a background and is always overlayed by the windows controls,
    and I can't figure out how to get it to "draw over" them.

    My question.. Is it possible to "draw" over these stock controls? I have
    tried many many things, but can not get this to work. Any help would be
    greatly appreciated, it would be a shame to scrap my UI at this point :(.

    Thanks,
    Robert

  2. #2
    Dan I Guest

    Re: OnDraw and Windows MFC controls


    In my limited experience you could try one of two things:
    (1) Make your drop down windows actual pop-up windows themselves. Provided
    they are higher in the z-order than the other controls, they will automatically
    appear over the stock controls. (or- since the stock controls are children
    of your form, the popup-menu should not be a child window)
    (2) Use the desktop DC, this will let you draw on anything- but be warned:
    As soon as the control re-paint themselves your menu will be obstructed.

    Hope this helps

    Dan I



  3. #3
    frans Guest

    Re: OnDraw and Windows MFC controls


    did you try all the stock properties of the controls in Editor mode?Setting
    the transparent property might help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links