how to call drawitem() function in ower draw Clistbox

Another question about ower-draw listbox: I created an ower-draw
Listbox and override the drawitem(LPDRAWITEMSTRUCT lpDrawItemStruct)
function. Is there any way to refresh the listbox by calling
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) after the user click on a
button? 

Thanks, 

Eileen

0
eileenlxh (13)
7/6/2006 3:24:31 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
1460 Views

Similar Articles

[PageSpeed] 43

> Another question about ower-draw listbox: I created an ower-draw
> Listbox and override the drawitem(LPDRAWITEMSTRUCT lpDrawItemStruct)
> function. Is there any way to refresh the listbox by calling
> DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) after the user click on a
> button?
>

Call Invalidate followed by UpdateWindow to force a redraw which will
in turn call your draw item. You can also invalidate only a portion of
listbox if you want (InvalidateRect instead of Invalidate).

--
Ajay

0
ajaykalra (6842)
7/6/2006 3:28:36 PM
Thank you!

Ajay Kalra wrote:
> > Another question about ower-draw listbox: I created an ower-draw
> > Listbox and override the drawitem(LPDRAWITEMSTRUCT lpDrawItemStruct)
> > function. Is there any way to refresh the listbox by calling
> > DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) after the user click on a
> > button?
> >
>
> Call Invalidate followed by UpdateWindow to force a redraw which will
> in turn call your draw item. You can also invalidate only a portion of
> listbox if you want (InvalidateRect instead of Invalidate).
> 
> --
> Ajay

0
eileenlxh (13)
7/6/2006 3:55:25 PM
eileen wrote:
> Thank you!
>
> Ajay Kalra wrote:
> > > Another question about ower-draw listbox: I created an ower-draw
> > > Listbox and override the drawitem(LPDRAWITEMSTRUCT lpDrawItemStruct)
> > > function. Is there any way to refresh the listbox by calling
> > > DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) after the user click on a
> > > button?
> > >
> >
> > Call Invalidate followed by UpdateWindow to force a redraw which will
> > in turn call your draw item. You can also invalidate only a portion of
> > listbox if you want (InvalidateRect instead of Invalidate).
> >
> > --
> > Ajay


i personally prefer in this case the function "RedrawItems()" so i
don't have to calculate myself what rectangle of the listctrl has to
invalidated. much easier to use.
regards,
martin

0
7/7/2006 6:10:01 AM
> i personally prefer in this case the function "RedrawItems()" so i
> don't have to calculate myself what rectangle of the listctrl has to
> invalidated. much easier to use.

Thats good to use if you dont want to draw the entire control. Its a
replacement for InvalidateRect. UpdateWindow still needs to be called
for immediate redrawing of items.

---
Ajay

0
ajaykalra (6842)
7/7/2006 2:58:58 PM
Is RedrawItems() a member function of CListbox?

Eileen

Ajay Kalra wrote:
> > i personally prefer in this case the function "RedrawItems()" so i
> > don't have to calculate myself what rectangle of the listctrl has to
> > invalidated. much easier to use.
>
> Thats good to use if you dont want to draw the entire control. Its a
> replacement for InvalidateRect. UpdateWindow still needs to be called
> for immediate redrawing of items.
> 
> ---
> Ajay

0
eileenlxh (13)
7/7/2006 4:36:02 PM
> Is RedrawItems() a member function of CListbox?

It doesnt look like it. I was thinking about CListCtrl::RedrawItems,
which does not apply to you.

---
Ajay

0
ajaykalra (6842)
7/7/2006 4:45:41 PM
sorry, my fault.
i mixed it up with CListCtrl, seems i didn't use CListBox for quite
some time.
regards,
martin

0
7/10/2006 6:24:25 AM
Reply:

Similar Artilces:

Call in?
Do new owners of Office X have to call up Microsoft to register their copy? If yes, what's the number? thanks. Ming <asdf@asdf.com> wrote: > Do new owners of Office X have to call up Microsoft to register their > copy? If yes, what's the number? thanks. Nope. We're not using Windoze :->>> This version does not require activation. Corentin -- - Mac:MS MVP (Francophone) - (MS) MVP: http://support.microsoft.com/default.aspx?ln=FR&scid=fh;FR;mvp Newsgroups produits MS: http://support.microsoft.com/newsgroups/?ln=FR ...

Covered Call Options
Hello all, I do I go about dealing with a covered call transaction in Microsoft Money 2007 Premium? Currently what I am doing is inputing the option symbol, and choosing the transaction "Sell to Open" then when I go to expire the option I try to do a Sell to Close. However it does not seem to work? Also what happens if instead of expired I has the position assigned? how would I account for that? Thank you. Shhhh In microsoft.public.money, Shhhh wrote: > >I do I go about dealing with a covered call transaction in Microsoft >Money 2007 Premium? Currently what I am doing is...

Call center tracking and reporting
Anyone use CRM 4.0 for call tracking? Our Sales/Marketing is set up. Now I need to decide how to most efficiently customize CRM 4.0 for our company's call tracking portion. Can someone send me a link to information? thanks ...

MAXA worksheet function
The functions MAXA and MINA appeared when I upgraded to Excel 2003. When I use them in a worksheet & try to save the result, I receive a message saying that these functions cannot be converted to the file format that I am using. The file format that I am using gives Excel 97, 2003, NT, 5.0 and 95. What am I doing wrong? Thanks! IIRC, MINA and MAXA appeared in XL97, so saving to XL5/95 compatible format won't work. Is there any reason you need to save in that format? It makes your workbook twice the size of saving it as an XL workbook (e.g., 97/03 format) since it saves both for...

telephone calls
when placing a telephone call using outlook, everything works fine except I can't hear the person i am talking to. They can hear me find. When I use a telephone program not associated with outlook every thing works great. can someone help ...

Fast drawing of graphs
Hello, I programmed a class that draws an x-y graph on a CStatic window. I used CClientDC for the CStatic window. If the graph has severel tens points, it is sufficiently fast. However, the graph may contain up to several tens thousand points and then the routine is very slow - about half a second or more. How can I make my routine faster? When I used Borland C++ Builder, this culd be easily achieved by not drawing directly on the, but drawing to a hidden bitmap and then displaying the whole bitmap at once. However I don't know how to do it in MSVC6. Thanks. Bolek Bolek wrote:...

Date Function #2
This is a multi-part message in MIME format. ------=_NextPart_000_0022_01C6152B.8E758000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Is there an easy way to compute the number of days in a certain month = between a starting and ending date? For example, how should I compute = the total number of days in March between two given dates? ------=_NextPart_000_0022_01C6152B.8E758000 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Trans...

Calling Macro
Hi All, I have macro like this sub unique() '''''''' '''''''' Counter_item = 0 For Each Item In nodups counter_item = counter_item + 1 bic_var = Item Call Ps_Match Next Item end sub I have another macro Sub Ps_Match() ''''' ''''' If counter_item <= 1 Then call another_macro() end if end sub In the first macro i am declaring counter_item equals to 1. In my second macro i need to call that number. At the to of the module put: Public Counter_I...

Excel Calculator always requires an = before a math function, can be turned off setting?
I often use excel as a fancy calculator. But often I forget to start the calculator with the = sign. So if I want to add 44 + 66, I forget to type in an = sign first, an it gives me an error message. Is there a setting to turn that off, so I can type in 44 + 66 and it gives me an answer. I always have Excel running and it's also my calculator. I never use use a calculator anymore! The answer to your question is no. The equal sign tells Excel that you're entering a formula that needs to be calculated. You can use a plus sign (+) instead of the equal sign (=) if you alwa...

Disabling automatic send function
I used to be able to have messages in my Outbox sit there till I hit send/receive by checking "disable send/receive" on the tools menu. For some reason, disabling send/receive now only disables the automatic receive function. My emails in my Outbox are sent automatically, as soon as they hit the outbox. I send monthly emails to my contacts thru the mail merge program in Word. I then go to my Outbox to attach a document to them. It used to be that if I disabled the automatic send/receive function in the tools menu, the messages in my outbox would sit there so I could add ...

Plotting functions
I am brand new to using the charting feature of Exel and am having trouble with what should be a simple operation. I want to create a graph of y=f(x) -- say for simplicity's sake f(x) = x^2. I have in column A, for x, the numbers -10 through +10 and in column B =A^2. Column B shows the correct values but have not been able to create the pretty graph I know so well. Would someone give me a bit of help here? Thank you very much. Where do you get stuck? Select the data range, click the Chart Wizard. In step 1 select the XY Scatter chart. That should give you what you want. ...

Workflow -Assembly Call
How does add subtract in the Workflow>> assembly call works. I do understand that ypu can write your own custom workflows, register it and then call them from here, but I am pretty confused with the existing functionality. workflows can call other workflows workflows can also call a method in a .net assembly. ie you could write a piece of code in c# or vb.net and then have the workflow call your code. ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "SAM" <SAM@discussions.microsoft.com> wrote in message news:DE...

Async calls to WebService in MFC
Hey guys, I use a webservice over the net which is scripted in VB.Net. This web service receives a username and a password and returns a string structure with multiples infos. If the string is empty, I had the wrong username and/or password. Pretty simple isn't? Ok now the problem is a bit more complex. I'm using an MFC client to connect to these web services, and since they're on the internet, there's a delay between sending the data and receiving an answer. I don't know really how I can tell me client to "wait for the string". The wrapper MFC created for the w...

report writer user defined functions
Hi, I need some information from some of the report writer functions. I've installed the SDK and I've reviewed the "RW Functions GLobal Scripts" document but the functions I'm looking for aren't in there. I looked through the CoreParams_1000.txt and was able to find the functions listed there, but that still doesn't tell me much. I need to see what these functions are actually doing and how they are doing it. Is there some way to open these functions and review the code. Is there a special software I need to do this? I have Visual Studio 2005 and 200...

Reset Picture Function
I have Publisher 2000 installed at home and Publisher 2003 installed at work. 2003 includes the 'reset picture' function which is great for reducing file size while keeping the pictures at an acceptable quality for printing. I cannot find this function in 2000. Is there an alternative method to achieve the same thing in 2000? Steve Spurgin <Steve Spurgin@discussions.microsoft.com> was very recently heard to utter: > I have Publisher 2000 installed at home and Publisher 2003 installed > at work. 2003 includes the 'reset picture' function which is great > for ...

Invalid procedure call or argument?
Hello All This is a re-post of a problem I posted a while ago, but to which I got no suggestions: hopefully I'll be more lucky this time!? I have the following code in a Private Sub: If InStr([ResponseXML], "element") > 0 Then errorfield = "Invalid " & Mid([ResponseXML], InStr([ResponseXML], "element"), InStr(InStr(InStr([ResponseXML], "element"), [ResponseXML], "'") + 1, [ResponseXML], "'") - InStr([ResponseXML], "element") + 1) Else .... Most of the time this works fine, but for some...

How can i draw a graph with days and months in the primary axis
How can i draw a graph with both line graph and bar graph, where both the graphs should be in days in which the satursay and sunday will not included. I need that graph's X-axis should shows the figures in Months. I made the share price graph of one year in days but the bar graph if i made that is being giving the gap where the data is missing for the weekends. But the line graph is not showing the gaps. I am trying to find the solution but unable to do that. In article <6887CCB1-F9A5-40A8-A77B-F1E3154A7E19@microsoft.com>, "=? Utf-8?B?U3VtZWV0IENob3ByYQ==?=" <Sumeet ...

Where to call SetWindowPos
In my SDI, can I place the following in CMainFrame::OnCreate( )? Or is there a better place? // ensure window opens on top when called by other applications, esp. the installer SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); Note that wndTopMost really means it is always on top and can never have another app come on top of it. So wndTopMost is often a poor choice. SetWindowPos would not be the best choice here; SetForegroundWindow would be better. joe On Sat, 11 Aug 2007 17:04:00 -0400, "SteveR" <srussell@removethisinnernet.net> wrote: >...

Unable to get DxgkDdiRecommendFunctionalVidPn call in windows 7
I am trying to add an initial vidpn topology by implementing the DxgkDdiRecommendFunctionalVidPn call in the WDDM miniport driver. But starting from windows 7 i am unable to get the DxgkDdiRecommendFunctionalVidPn function call from dxgkrnl.After searching through the MSDN documentation i found out that the function is deprecated starting from windows 7. msdn link: http://msdn.microsoft.com/en-us/library/ee220395.aspx According to msdn "On a computer running Windows 7, the display mode manager (DMM) determines an appropriate VidPN topology to apply using VidPN history d...

Trial Project Server 2007 Functionality
Hi, I want to install a trial version of Project Server 2007. I can't find anywhere saying what functionality appears with the trial version. Do I get full functionality after installation or is it limited in any way. If it is limited, I would like to know what I get in order to make a full and proper evaluation. Thanks for your help. Fahim Microsoft trial software is full-featured. In order to evaluate all of the capability of Project Server, you'll need to use companion technologies like SQL Server 2005 or 2008, Windows Server, and Project Professional -- ...

Call out to detect attaching files
Hi All, Is there a method to write a callout to detect file uploads. i knoe that when i file is uploading it's going to annotation entity. i have written preupdate and postupdate methods to track this. but when i add a file the event doesn't get fired and doesn't indicate the changes. later if i do a change to the note then i'm able to see the changes. can anyone tell me the reason... Thanks, Charith On Aug 7, 2:34 am, Charith <Char...@discussions.microsoft.com> wrote: > Hi All, > > Is there a method to write a callout to detect file uploads. i knoe tha...

Help please, what Function?
if i have sheets with data listed like this:- C E G I K M O Pressure Names of Officers Pay Signature of Hours (see note 1) Total listed for overtime number Officer Cause From To H:M P11 SURNAME. 1 4534 05:00 06:00 01:00 B13 SURNAME. 1 4534 06:30 07:00 00:30 B15 SURNAME. 2 2475 07:00 07:30 00:30 B16 SURNAME. 2 2475 07:30 08:00 00:30 G11 SURNAME. 3 9341 08:00 08:30 00:30 B33 SURNAME. 4 12331 08:30 09:00 00:30 B17 SURNAME. 5 23211 09:00 09:30 00:30 ...

World Wide Calling! Unlimited Incoming Calls.
New virtual access anywhere technology lets you call anyone, anywhere in the world, from any phone! Access: http://pt.telextreme.com/743499 ...

Error with NETWORK DAYS function
Im trying to use an old spreadsheet that I have not used for a few months. But when I go back to try and update the data, I am getting the #NAME? error in the result cell. I have just tried to update an existing time by just 1 hour and it loses the result. The sum that is running is: =((NETWORKDAYS(D10,F10,K9:L10)-1)*10)+((G10 -E10)*24) we work a 10 day, monday - friday and are looking to calculate the difference in hours between 2 dates and times. If anyone can assist here I will be most grateful. Not to worry people, I have sovled it myself. I had upgraded Excel since I last used ...

Pub98 line drawing tool
Hey Gang! Long time no type. Had a problem crop up all of the sudden. My line drawing tool is now defaulting to a left pointing arrow line, not the plain line it's been for seven years. Any thoughts on where the default setting may have changed? I don't see any simple, logical location for the setting. thanks in advance, Steve in NC Does this occur in all publications? Click the line tool in the objects toolbar, (do not draw a line) on the command toolbar, click the line format, select the formatting you want. This will default to whatever line you selected for the rest of th...