How to eliminate flicker of common controls?

i created several common controls( list-view(report), tab, rebar) with
"Create(...)" methods of them, and everything goes well except that they all
flicker while i resize them. and i think the issue is from the "windows
style" i used, so which "window style" is right selection to figure them
out. or if it is natural effect( there is no window style for that ), then
how to figure them out with any resolvents. very thanks :-)

--
Frank F.Han

+-----------------------------------------+
|         winsays@:-)hotmail:-).com       |
+-----------------------------------------+


0
winsays (30)
7/1/2004 1:18:20 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
477 Views

Similar Articles

[PageSpeed] 20

By default, a control fills itself with the background color when it gets a WM_ERASEBKGND message, and then redraws itself when it gets WM_PAINT. The erasing and redrawing causes the flicker.

The solution is to override the WM_ERASEBKGND handler (just return TRUE without calling the base class's method), and the WM_PAINT handler to paint your control.

Keith Rule's double buffer memory DC lets you do flicker-free drawing really easily:
http://www.codeproject.com/gdi/flickerfree.asp

-Larry

"Frank" wrote:

> i created several common controls( list-view(report), tab, rebar) with
> "Create(...)" methods of them, and everything goes well except that they all
> flicker while i resize them. and i think the issue is from the "windows
> style" i used, so which "window style" is right selection to figure them
> out. or if it is natural effect( there is no window style for that ), then
> how to figure them out with any resolvents. very thanks :-)
> 
> --
> Frank F.Han
> 
> +-----------------------------------------+
> |         winsays@:-)hotmail:-).com       |
> +-----------------------------------------+
> 
> 
> 
0
Larry1461 (99)
7/1/2004 4:50:01 AM
Reply:

Similar Artilces:

changing the size and position of controls as the main dialog size changes
HI I am a beginner in VC++. I have created a simple dialog based program. I have placed an edit box in the dialog, what can I do so that as I change the size of the main dialog , the edit box size and position will also change in ratio with the main dialog Use MoveWindow Function lke this.. CRect rect; GetClientRect(rect); GetDlgItem(IDC_EDIT)->MoveWndow(0,0,rect.Width(),20); Cheers Tony "msnews.microsoft.com" <kwadowkwadow@yahoo.com> wrote in message news:OWX372YJGHA.1192@TK2MSFTNGP11.phx.gbl... > HI > > I am a beginner in VC++. I have created...

help about owner draw ListView Control on CListView Class
Dear Sir, I have create a app that have three view, one on top and others on bottom, after a while, change the top one to ower draw ListView control . I have made the change in oninitupdate member to subclass the control to make it owerdraw , when the new CListCtrl class is assert , it fail, how can I build a CListView view with ower draw CListCtrl // a class based on CListCtrl CListCustomCtrl m_lstinfo; .... CListCtrl &lstctl = GetListCtrl(); m_lstinfo.attach( lstctl.m_hwnd ); <== this line of code assert failed your help is needs thank Eric, You are most likely getting an as...

Cam all calendars feed a common calendar
I have a need for one of my offices to have all their calendar information from their Outlook Calendar to feed a common shared calendar. Can this be done with Exchange 5.5 and Outlook 200,2002,2003? Also, can you hide the details from showing on the common calendar Thanks Jason What you want is not native to Exchange. If such a third-party application exists, it'd be listed at http://www.slipstick.com. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "Jwhitaker" <anonymous@discussions.microsoft.com> wrote in message news:1B485...

How to overlap controls in a dialog?
I have an MFC dialog which contains an edit control and a combo box ex which are the same size and which overlap exactly. Please don't stop here and tell me why I don't want to do this. It is the right UI for my situation, and I will only give it up if it can't be done with reasonable effort. The combo box is normally inactive, and user enters information in the edit control. When user clicks a button, the combo box becomes active, in the following unusual way: 1) The combo box list is populated. 2) The list is set to the proper width, to accomodate the widest entry. 3) The list...

Set Text Box Control To Blank
I have a procedure that executes on the beforeupdate event of a textbox (text24). The procedure works out the checkdigit for the number entered and if there is a discrepancy, a message box appears telling the user the number is wrong. What I'd like to do is modify the code as such so that when a discrepancy is found and the user clicks ok on the message box, focus is returned to (text24) and set to blank so that the faulty number is gone. Here is the code I am using.... It's quite crude as I'm only at beginner level, but hey, it works! Private Sub Text24_BeforeUpdate(Cancel As Int...

Eliminate unused columns
I have a table of columns of data per week, which I convert to a table of columns of data per month. This leaves 3 or 4 blank columns between the months. Is there a simple way to consolidate the month columns into a contiguous region, eliminating the unused columns between the month columns? Or... is there a smarter way to do the conversion than sum across an fill down? One approach is to use a macro: if your empty columns are completely empty you could use this macro. Hit Alt-F11, Click Insert/Module (check the project window to make sure your workbook is the active project before...

Date Elimination
I have a worksheet with mainly dates in column A in the format of '25 Aug 2008'. Is it possible with a macro or similar to delete lines beyond a certain date (2 years hence)? Basically, I'm not interested in data more than 2 years old. This would eliminate a lot of data and make for a more viewable worksheet. try this Sub del_date() ActiveCell.Range("A1").Select Do Until ActiveCell.Value =3D "" dt =3D Date - 730 If ActiveCell.Value <=3D dt Then ActiveCell.ClearContents ActiveCell.Offset(1, 0).Select Else ActiveCell.Offset(1, 0).Select End If Loop End ...

Form Controls on Excel worksheet
Hello, can I use an array as input range for a (form) combo box ? Kind regards, H.G. Lamy You have to manuall in code use Additem to put each item of an array into a combobox for i = 0 to Ubound(MyArray) Listbox1.additem MyArrray(i) next i -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=170371 [url=&quot;http://www.thecodecage.com&quot;]Microsoft Office Help[/url] Thank You ! H.G. "joel" <joel.44u...

Automatic control names
I feel stupid asking this question, but I can't find any previous posts about it. Is it possibe to set Access 2007 so that the forms wizard will name the controls properly? The default is to name the control with the field name of the data source, but it ignores the proper naming conventions (or at least what I was taught was the convention). A textbox should be named "txtFirstName", but instead it just names it "FirstName", which then requires us to have to go through and manually rename all the controls. I suppose that a VBA routine can be written, but af...

eliminating duplicates
I need to elimnate duplicates the following script. I believe what is creating the duplicates is the provcont table, there are different provcont ids for each record. Thanks in advance. SELECT PROVCONT.C_FAX, PROVIDER.NAME, PROVIDER.PROV_PATH, PROVIDER.PROV_ID, PROVSTAT.STATUS, PSTATUS.DESCRIPT, PROVCONT.CONTAC_ID FROM PROVCONT INNER JOIN PROVIDER ON PROVCONT.PROV_ID = PROVIDER.PROV_ID INNER JOIN PROVSTAT ON PROVIDER.PROV_ID = PROVSTAT.PROV_ID INNER JOIN PSTATUS ON PROVSTAT.STATUS = PSTATUS.STATUS WHERE (PROVIDER.PROV_PATH = 2) AND ...

eliminate duplicates
I have a table with 7 different columns of team members on different teams. I need a count of all team members. How do I query seven different columns and eliminate dups? You've discovered yet another problem with denormalized tables. If you have 7 different columns, each containing the same basic information, you have a repeating group. If you can't go back and redesign your tables, the easiest approach would be to create a UNION query that normalizes the data so that it's in only 1 column: SELECT Member1 AS Member FROM MyTable UNION SELECT Member2 AS Member FROM MyTabl...

Dialog Box & Edit Control
I have an Edit Control inside a dialog box. I am adding some text to the edit control and then showing the dialog. However, the text does not appear in the edit control. http://i42.photobucket.com/albums/e322/ahsan19/dialog.jpg To test the program, I assigned a message handler to the OK Button. Now whenever OK is pressed, the program attempts to write in the EditControl and it succeeds! http://i42.photobucket.com/albums/e322/ahsan19/dialog1.jpg So why does the text not show up in the edit control when it is initialized before displaying the dialog box? Any ideas? Thanks. Jess &q...

Adding Controls To The Visual Studio 2008 Toolbox
I have a control library that contains several controls that I want to add to the Visual Studio 2008 toolbox for use in Web Applications. I have done this before, so I know how to do it. However, when I attempt to do it this time it refuses to add one of the controls. The one control that does not get added inherits from System.Web.UI.HtmlControls.HtmlAnchor, and I am wondering if the fact that it is inheriting from an HtmlControl has anything to do with the fact that it is not being added to the Toolbox. This control works perfectly fine, and I am able to use it perfectly fine i...

eliminate message from append query to eliminate duplicate record.
Create a new query in design view. Add the two tables for which you wish to compare. When you see the two tables in the design view of the query click on one of your 2 join fields and drag to the corresponding join field in the other table (a line should appear) then double click on fields to add them to the query. For your comparison field Your going to have to explain how you want to compare the two fields. What type of field is in table B, and what kind of comparison do you want to do? You could start with something simple like entering "ComparisonField:Iif(tableA.field1=tableB.field2,...

Transparent controls in WM 5.0
Hi Friends, In WIN 32 there is an API SetLayeredWindowAttribute for making a window transparent. Can any body tell me if i want to make control transparent in WM 5.0 which API i should use. Please tell me. On Sep 19, 3:13=A0pm, neeru <neeraj.al...@gmail.com> wrote: > Hi Friends, > In WIN 32 there is an API SetLayeredWindowAttribute for making a > windowtransparent. > Can any body tell me if i want to make controltransparentin WM 5.0 > which API i should use. > > Please tell me. Hi Friends, I hope somebody will tell me how to achieve this..... It's a priority ...

i have #name? at my control
i have #name? at my control. I cobined these functions (iif(), left(), right(),count() ,integer() and the concatenation sign(&)) to change numbers into texts on a form . It woked well as i wanted . after a perioud of using my system perfictly I faced this problem. i began trubleshooting to determine the cause . the cases noted by "help" missed the problem .i removed the ms_office and reset it up and checked the refernces and unchecked the microsft missing refernces. but the problem still faceing me . i copied my system in another computer is worked well. them i formated m...

SubReport Controls
I have 2 subreports on a main report. I need to refer to a control on one subreport from the othrt subreport. This doesn't seem to return anything. =Reports!rptEOD.rptEODSales.Report!TxtGrandTotal Any help is appreciated. Thanks DS In this case I you could use a 'dummy' on the main report where you put the value of the first subreport control. The other subreport can look at the dummy placed on the main report (makes the reference a lot easier to write) and then reference that from your second subreport. -- Maurice Ausum "DS" wrote: > I have 2 subreports ...

Best practices for GUI of what called in MFC custom controls
Hello All, I have MFC-based application featuring: 1) Flow of "Screens" where screens are implemented as a MFC's CDialog-inherited classes loading PNG or BMP images. 2) Dialog's child controls also loads PNG or BMP images. What is the best practice to handle the same functionality in .NET/C#? Thanks, You should post this in C# newsgroup to get appropriate responses. In .Net, you can use WinForms to make the app. Equivalent of a child control is a UserControl in .Net. Its much easier to code and more powerful than MFC. WPF is the newest technology that is mean to rep...

eliminating hyper links
Version: 2004 Operating System: Mac OS X 10.4 (Tiger) Processor: Intel How do I get word not to link when I make reference (footnote in a book) preceded by http: etc? Daniel_Barnett@officeformac.com wrote: > Version: 2004 Operating System: Mac OS X 10.4 (Tiger) Processor: Intel > How do I get word not to link when I make reference (footnote in a book) > preceded by http: etc? From Word > Preferences choose the AutoCorrect button. Click the AutoFormat as you Type tab. Uncheck Internet and network paths and hyperlinks Click OK There's more about this on the fo...

List Control Header Notification are missing!!!
Hello, I know that this issue has been discussed allready several times before, but I didn't find a working solution for me. I can not get any notification from my CListCtrl Header control. There were talking about ON_NOTIFY_REFLECT instead of ON_NOTIFY, but I have ON_NOTIFY as needed. Also, I derived a ListCtrl from CListCtrl and tried to get the notifications there, but I didn't. I try to recieve the dblclick or itemchange messages. Thanks in advance~! <dushkin@012.net.il> wrote in message news:faecfce7.0401050144.43bf8e2e@posting.google.com... > Hello, > I know tha...

DPMRA on Domain Controller in different forest...
I have a DPM 2010 server(sv-dpm1.company.local) in one domain (company.local) which is backing up a few servers in it's own domain as well as a child domain (ext.company.local) without any issue. I need to have this DPM 2010 server backup a few servers in another forest (clients.local,) two of which are domain controllers (dc-1.clients.local, dc-2.clients.local) for the clients.local domain. I have manually installed the DPMRA 3.0.7696.0 on each domain controller in the clients.local domain and have used SetDpmServer as required. (setdpmserver.exe -dpmservername sv-dpm1.c...

Is there a Third Party Fuzzy Lookup Control For SSIS
I am creating an SSIS package to remove duplicates from (currently) the persons table. We have approx. 50 clients, each wanting to set their own paramenters for what they consider a viable match. So, example Overall match: 60% Manual Review Field Match (The following MUST add up to 100%) Prefix: 2% First Name: 20% Middle Name 3% Last Name 40% Suffix 10% SSN 15% DOB 10% Driver's License 0% Mother's Maiden Name 0% I am using the Fuzzy Lookup transformation component to do this. Will set the minimum similarity in the column relationships to reflect...

Problem with Controls added from Controls Toolbox
I have a spreedsheet where there are several controls added, command buttons and listboxes. On some PC's users who move to different worksheets and back to the one with the listbox on it find the list displayed getting smaller and smaller each time. Or they click on a command button and the text displayed on the button gets smaller, until it disappears. Closing the workbook and reopening does refresh these controls fonts to original settings. Any suggestions as to what is causing this and how to resolve it? Jim Rech offered this solution: http://groups.google.com/groups?threadm...

Double_Click Control Event firing too soon, why?
I have a Access 2002 DB with a tabbed form. On one of the tabs there are 2 unbound subforms (AuthsSub, PlanSub). Both subforms display in Datasheet view. Both link to the Parent form by a common ID field (AbsID). All the underlying tables are ODBC-linked SQL tables. Users use these 2 forms pretty much simultaneously. This combination has been in production for years with no reported problems. The date fields on both subforms have Dbl-Click events which launch frmCalendar allowing users select a “correct” date. What is happening is the user will finish selecting or ente...

Format Control of Spinner
I would like to have the incremental change be .01 - is this possible -- ldebond ----------------------------------------------------------------------- ldebondt's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3660 View this thread: http://www.excelforum.com/showthread.php?threadid=56346 Nope. Suggest you just divide its value by 100 for further calculations. HTH. Best wishes Harald "ldebondt" <ldebondt.2b9fa5_1153425608.5183@excelforum-nospam.com> skrev i melding news:ldebondt.2b9fa5_1153425608.5183@excelforum-nospam.com... > > I would...