?
Solved

Drawing on top of a listbox

Posted on 1997-02-22
1
Medium Priority
?
451 Views
Last Modified: 2013-11-20
I have created a custom class derived from CListCtrl.  I want to have a standard entry field (CEdit) on top of one of the rows in the ListCtrl.  I will be hiding/showing it from time to time.  Sort of mimic'ing the cool in-place editing feature of the directory listbox for MSVC's options box.

I have been able to draw and show the edit field just fine, however if the CListCtrl needs to be repainted (let say a window covered it up for a second), the CEdit field gets painted first and then the CListCtrl paints over it.  All I see is a blinking caret when the window is done repainting.  It seems this is the order in which MFC paints the controls.  
Here is what I have tried:

1)  I have flagged the CListCtrl as transparent.  Funny thing, the on-line help says transparent windows will get called last, huh?  That doesn't make sense.

2)  OnPaint message for custom CListCtrl.  -- Doesn't work.  Everytime I update the window (i.e. draw something on top of it) it loops endlessly (like it wants to repaint it again and again because of my painting on top).

Is what I am doing possible?  I really don't want to draw the listbox and everything relating to it myself, I just want to paint something on top and use the listctrl as a normal listctrl.

Is this possible?

Tom
0
Comment
Question by:tdietz
[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
1 Comment
 

Accepted Solution

by:
YZ earned 200 total points
ID: 1300286
First, CEdit object should be the child of CListrCtrl object.
Then, you should not send any invalidate messages to edit, it would be updated when it neccessary to windows. Forget about transparency - there is nothing common to the problem you got.
And the next, if your CEdit using some yours class subclassed from stabndard "EDIT" (RegisterWindowClass....), then check if your class does not have style CS_PARENTDC.
That should help.

BTW. I did the same thing with my own CListBox
derived class in Win3.X/95, and got no problems with this. Ask me if you want some sources.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

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…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

764 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