Child controls not being invalidated

Folks,

I have an MFC problem that I have struggled with for a while where a
control in a child dialog is not always invalidated/redrawn correctly.
Please help!

I have a series of classes as follows (parent/children):

CFrameWnd-derived (ultimate parent)
-> (a) modeless CDialog-derived class (with CTabCtrl)
 -> (b) modeless CDialog-derived class (tab page)
  -> CStatic-derived class

Class (a) hosts a tab control and shows/hides a number of different (b)
modeless dialogs depending on the tab selected.  These classes are
members of (a) and are constructed as children in (a)'s constructor.
They are then created when first shown using CreateIndirect (using a
modified version of the dialog resource template), again passing (a) as
the parent.

One of the pages hosts a CStatic-derived class used to display a graph.
 Above this is a CComboBox which drops down to partially cover the
graph.  When the drop-list of the combo box closes, the graph is
correctly invalidated and redrawn.

My problem is that if, say, a separate modeless dialog (another child
of the ultimate parent) appears over the graph control, the graph is
not invalidated properly and is left with a grey rectangle which looks
frankly cr*p.  Note that the graph is redrawn OK if you move the dialog
around above it, but not when the dialog is closed...

I've tried various combinations of WS_EX_CONTROLPARENT and WS_CONTROL
but this seems to be more for keyboard (TAB) handling, not painting
issues.

I would apprecaite any thoughts / guidelines / fixes you can give me.

0
8/8/2005 10:58:31 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1043 Views

Similar Articles

[PageSpeed] 29

The (b) dialogs and the tab control are all siblings, sharing (a) as their parent, correct?  And 
depending on which tab is selected, only one of the (b) dialogs is shown at a time?  This graph 
control is a child of one of the (b) dialogs, correct?  Under what circumstances could another (b) 
dialog obscure the graph, if only one tab page is shown at a time?

<mark.cooke@oxinst.co.uk> wrote in message 
news:1123498711.347499.61510@g49g2000cwa.googlegroups.com...
> Folks,
>
> I have an MFC problem that I have struggled with for a while where a
> control in a child dialog is not always invalidated/redrawn correctly.
> Please help!
>
> I have a series of classes as follows (parent/children):
>
> CFrameWnd-derived (ultimate parent)
> -> (a) modeless CDialog-derived class (with CTabCtrl)
> -> (b) modeless CDialog-derived class (tab page)
>  -> CStatic-derived class
>
> Class (a) hosts a tab control and shows/hides a number of different (b)
> modeless dialogs depending on the tab selected.  These classes are
> members of (a) and are constructed as children in (a)'s constructor.
> They are then created when first shown using CreateIndirect (using a
> modified version of the dialog resource template), again passing (a) as
> the parent.
>
> One of the pages hosts a CStatic-derived class used to display a graph.
> Above this is a CComboBox which drops down to partially cover the
> graph.  When the drop-list of the combo box closes, the graph is
> correctly invalidated and redrawn.
>
> My problem is that if, say, a separate modeless dialog (another child
> of the ultimate parent) appears over the graph control, the graph is
> not invalidated properly and is left with a grey rectangle which looks
> frankly cr*p.  Note that the graph is redrawn OK if you move the dialog
> around above it, but not when the dialog is closed...
>
> I've tried various combinations of WS_EX_CONTROLPARENT and WS_CONTROL
> but this seems to be more for keyboard (TAB) handling, not painting
> issues.
>
> I would apprecaite any thoughts / guidelines / fixes you can give me.
> 


0
ScotB (233)
8/8/2005 1:11:01 PM
Hi Scot,

you are correct in your assumptions but to answer your question:

> Under what circumstances could another (b) dialog obscure
> the graph, if only one tab page is shown at a time?
>
The dialog which does the obscuring is a separate modeless dialog child
of the ultimate CFrameWnd-derived parent...

I should probably mention that this child is WS_POPUP _VISIBLE and _3D
and I have just noticed that it does not set Clip Siblings/Children.
One quick test later... nope, that makes no difference.

Cheers and thanks for responding...

0
8/8/2005 1:44:22 PM
Reply:

Similar Artilces:

Multiple control selection
Hi Everyone, I have a worksheet that has 100 checkboxes on it. I want to select 50 of them and enable the check on them. I remember in excel2003 i could put a selection box around them and change the property on these, but in excel2007, the seleciton box doesn't seem to work... can somebody help? Thanks in advance. Hi, Undoubtly a bug. If they are always the same checkboxes you want to select you could group them - select them and then choose Page Layout, Group, Group. Then one click gets them all. -- If this helps, please click the Yes button. Cheers, Shane Devenshire ...

no notification from list control when check box selected?
hi there i have a list control in an MFC app for which i set CheckBoxes ON (LVS_EX_CHECKBOXES) i need to know when the user checks/unchecks any item is there a specific notification sent to the owner when the user checks/unchecks an item? or do i watch for the more general LVN_ITEM_CHANGED notification (which doesn't seem to give info specific to checking/unchecking - the closest thing seems to be a State Image Mask change)? tia bhu >i have a list control in an MFC app for which i set CheckBoxes ON >(LVS_EX_CHECKBOXES) > >i need to know when the user checks/unchecks any ...

CPaintDC and Tab Control ?
Could any one explain how this code segment could be correctly written. It's a dialog-based program with a tab control. And for this example, two bitmaps should be painted on Tab2 of three. And any variable not declared locally is declared in the class declaration. Also, I need to paint them directly onto the dialog form since there will be many small bitmaps (in the thousands) row after row with 12 to 20 in a row. void CTab2::OnPaint() { CPaintDC dc(this); if(bUpdateBmp) { bmp.LoadBitmap(Crd); bmp.GetBitmap(&BmpInfo); dcMem.CreateCompatibleDC(&a...

Invalid detail on axis
Hi guys, Need some help with this please. I have a chart that sources its data from another worksheet. The dates on the bottom axis need to run from 08/08/09 to 27/03/10. Currently they run fine up until the 13/03/10 when just a number is returned rather than the date. On the source document, the axis is pulling from cells in a row that goes from 08/08/09 up until 27/02/10 - then from 06/03/10 onwards, the cells are in a different row. I am splitting the dates on the chart into fortnightly (30/01/10, 13/02/10, 27/02/10 . . . ) and it just isnt pulling the dates from the second ...

Who has the control?
Access is multisharing. But who has the last laugh? Who has the control? If used concurrently by many users who decides what goes in? Is there a field which decides who is the Author? Thanks As soon as anyone enters data into a bound field it will be stored (unless you have a beforeupdate event to stop it or simlar). Not really sure what your question is - can you give more details -- Wayne Manchester, England. "dindigul" wrote: > Access is multisharing. But who has the last laugh? Who has the control? If > used concurrently by many users who decides what goes in...

MFC Table control or similar control
Hi, I have a MFC dialog database application that returns data which i then put into an excel spreadsheet and display onscreen. Due to license issues i would like to write the data to a user defined control. I would like this control to have a similar tabular look like the excel spreadsheet. It should also have the option on control to print out what data is in the control. I would also like to be able to put a bitmap on the control (Showing a logo). Can anyone give me advice on how what control(s) i should use to accomplish this? Thanks In Advance Macca You could buy a third party ...

LParam in a list control
I am trying to create objects and store their pointers in the LParam of my list control. This all works, but clearly I need to tidy up these objects when an item is deleted from the list. I have written a DeleteAllItems method which loops round all the items and clears the list and deletes the objects so all should be well. Problem is that I get memory leaks when the app closes, so I am obviously not deleting the objects. My test populates the list with 5 objects and deletes them, then re-populates with 5 objects again. I call my DeleteAllItems method once myself, then once automaticall...

Invalid User Authorization after redeployment
Howdy! I redeployed my production CRM 4.0 rollup 6 installation to my DEV server and am receiving this error message when trying to access the DEV installation. The user authentication passed to the platform is not valid. The procedure I was following was to: - uninstall CRM 4.0 and detach and rename my databases - copy and import recent production backup - install CRM 4.0 and apply rollup 6 with bogus organization - use deployment manager to import organization from DB I had a timeout the first time through but attempted to import org again and it finished normally. However, now when ...

ActiveX control to send appointment?
Currently I use Microsoft MAPI Session and Messages Controls to programatically send mail. I don't see how to use these controls to send an appointment. Does anyone know what ActiveX controls are available to send appointments to Outlook clients or how to use the MAPI controls to do this? Thanks You have to use actual Outlook automation code to do that by sending out meeting requests. Look at www.outlookcode.com to see examples of Outlook automation code. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003...

Child dialog's
Hello , I am able to limit the app to single instance. But the child dialog's (modeless) could not be limited to single instance. I mean I want to limit the child dialog's to be single instance. Also I could not bring the child dialogs to focus by using tab. Could you let me know how to do this ? Thanks in advance, Ravi I don't understand the problem. class CMyMainDialog : public CDialog { ..... private: CMyChildDlg m_ChildDlg; }; void CMyMainDialog::BringupTheChild() { if (m_ChildDialog.m_hWnd == NULL) { m_ChildDialog.Create(....); } m_ChildDialo...

Pages of a Tab Control
Is it possible to have a page of a tab control either highlight, blink, change colors, become bold or some other way of identifllying which pages have been filled out and which has not. We have several pages on our tab control and I don't want to have to go to every page and check the sub-forms to see if they have been filled out. Thanks for any help I can get, Danny hi, On 20.04.2010 13:08, tankerman wrote: > Is it possible to have a page of a tab control either highlight, blink, > change colors, become bold or some other way of identifllying which pages > ...

Print pdf file on WebBrowser Control
I am trying to Print pdf file on WebBrowser Control using javascript code window.pdf_frame.print();. It is working fine but freezing machine very often. I am using Adobe Acrobat 6.0. How can I Print pdf file on WebBrowser Control without freezing machine. Thanks in advance. Bob Info you provided is not going to be enough to figure out what you are asking. In addition, you would be better served if you ask this in a related newsgroup: microsoft.public.inetsdk.programming.webbrowser_ctl ------ Ajay Kalra ajaykalra@yahoo.com ...

Change Display Control on a Table Programmatically
First, let me begin by saying that I don't know VB. I have been trying to do this using a macro. I need to set the display control for a field in about a 100 tables. Currently, the Yes/No field has a Display Control of Text and I need it to be a check box. When I created a macro using the following actions, I get an error message that it doesn't recognize Tables!. Does this mean that I can only use run code for forms and reports. Please excuse me if the question is stupid. I am trying to muddle along until I can take a class. Open Table: City Design View Edit ...

How to restor control on Administrative group
Hello, I have several MS Exchange 5.5 for each department we have one Exchange and one administrative group. We lost our server and in thats why we install MS Exchange 2003 (we have licences, but central organization didn't upgrade from 5.5 to 2003) and we connect it to our Administrative group and everything is working fine. But if I browse throught Exchange System Manager, I see all Administratives groups without colors (gray). If I create new admistrative group, that it is shown with colors (red). What means thet my Administrative group is gray? Does it mean, that I havent contr...

MFC and controls on toolsbox
Hi, I was wonder how to enable all MFC control available on "Windows Forms" tab for example ? i need to have access to control Panel and is disabled... where could i find help on internet for that ? thanks Maileen ...

Control Tip
Hello, Is there any way to add a new line to the control tip? Right now my control tips are really long. I am displaying the functions that users can perform if they click a button. For example, a button labelled "Reports" would display "Project Status Report", "Data Entry Status Report", "Resource Usage Report"....all on one line. Instead, I would like the following display to appear on hover Project Status Report Data Entry Status Report Resource Usage Report Any advice will be greatly appreciated. M. Wilson Use a CNTRL Enter to drop dow...

tab control question
I have a form with a tab control with about 15 tabs. Each tab is populated by a subform (the entire tab is the subform). The intent was to make the form modular and flexible. I have about 50 subforms in use, and depending on which layout the user selects, 15 are loaded on the tabs. Problem is, this is too slow. If I loaded all subforms in the background (not on the main form) set to visible=false, then loaded the already open subform on my tabbed form and set it to visible, would this help speed things up? Any other ideas? THanks so much. -- sam smk23 wrote: > I have a form with ...

Copying sheets
I have a template that has some controls on it with associated code. It is necessary for my task to dynamically create worksheets based o this template. My problem is that the names of the controls chang when a sheet is copied and therefore when used Excel cannot find an code to execute and the control does not perform its function. I coul set up a workbook with, for example, 100 templates and delete 90 if th user only needs 10, but this seems really messy. Any suggestions gratefully received. Thanks -- Message posted from http://www.ExcelForum.com Sorry, I hope nobody minds me bumping...

Use two combo boxes to control a third
I have a form and a subform. In the subform is a combo box (#3). I want to filter the list of available options for this combo box based on the selections made on two other combo boxes (#1) and (#2). I was able to get this to work by putting the code as a condition on the query for combo box #3 when all three combo boxes were on the same subform. But I wanted combo box #1 on the main form, while I kept combo #2 and #3 on the subform. I can get combo box #3 to respond to the criteria found in Combo #1, but not both #1 and #2. Is this even possible? Thanks in advance for the help! If I w...

POS- Invalid procedure call or argument-URGENT
newly installed RMS POS 2.0 it was working fine now if i'm trying to open POS i'm getting this error and the POS wont start. I'm getting the same error when starting the client, SO is working no problems This is a multi-part message in MIME format. ------=_NextPart_000_0A85_01C7720C.72FE9750 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dani, Need more info, but did you install as an Administrator? =20 Have you tried running a repair install or install on top of itself? Did it run through the registration process? --=20 Je...

Using ModifyStyle to Change an Edit Control
I have been experimenting a bit with controlling edit controls. Using the resource editor, I created an edit control on my dialog box accepting the default left justification. When I tried to change justification with ModifyStyle: m_SelectedRxMode.ModifyStyle( ES_LEFT, ES_CENTER, 0 ); nothing happened. Looking at the examples at http://www.codeproject.com/editctrl/editctrltutorial.asp, I noticed they explicitly remove the undesired justification so I tried it: m_SelectedRxMode.ModifyStyle( ES_LEFT | ES_RIGHT, ES_CENTER ); but no luck again. What am I missing here? Thanks...

Setting for multiple controls <ekXTh.42469$VU4.14648@bgtnsc05-news.ops.worldnet.att.net>
Did you know you can just select all the controls on the form in design mode by typing CTRL-A (or alternatively multiple by holding down SHIFT and then clicking on each one). Then with all you want to change selected do the Conditional Format and it will apply to all! EggHeadCafe.com - .NET Developer Portal of Choice http://www.eggheadcafe.com ...

Lebans RTF2
I've attached 2 links to screen shots (hopefully they'll work). Form.JPG shows my form. As you can see i've placed a #1 in each of the corners. http://filedb.experts-exchange.com/incoming/2008/03_w11/t10710/Form.JPG When I execute my 'View' button (Report.JPG) you'll see that in my report there are some huge bottom and right margins in the RTF Box. I've extended the size of the RTF box all the way out, but this is how it's displaying. The right-hand "1's" need to be on the far right of the report. Ugh. http://filedb.experts-exchange.com/incoming/...

How to get list of immediate child directories
Hi Experts: I'd like to get a list of directories (not all sub-directories, but only the immediate child directories). For example, if I'm in C:\WUTemp, and there is two sub-directories: C:\WUTemp\dir1 and C:\WUTemp\dir2; I should get a list of directories like this: C:\WUTemp\dir1 C:\WUTemp\dir2 Thanks in Advance! Polaris Take a look at CFileFind. You can check to see if the file found is a folder and you don't have to drill down. In fact, you'd have to go to a lot of trouble to build a recursive routine that does drill down into sub-folders. Tom "Polaris&...

multi-colored text for a list control in a CFormView
What would be the best way of implementing multi-colored text for a list control in a CFormView? For example, if the text for one of the rows is as such: CString text = "^1Multi^2colored ^3Text"; I'd like it to show up as Multi(in red), colored(in green), and Text(in yellow). I'm guessing that I would have to parse the string in an owner drawn list control. Does anybody know of any examples of this, or have an idea? You're going to have to derive your own list control class from CListControl,and override the virtual methods Create and DrawItem. Here's the basic ...