Owner-draw checkbox and Double-click

Hello,

I have an owner drawn checkbox (see my post "Checkboxes: SetCheck() and
BS_OWNERDRAW", 8/18/2003). It works great whether the user clicks on it or
hits the space bar when it has the focus. However, when the user
double-clicks the checkbox and tabs to another control, a heavy black
rectangle is left behind. I noticed that this related to my usage of
DrawFocusRect() in my DrawItem() function, but I cannot figure out how to
properly address the problem.

DrawFocusRect is called in two different places in DrawItem():

 if( lpDrawItemStruct->itemAction == ODA_DRAWENTIRE )
 {

    // Draw the checkbox
    ( ... )

     // Check whether we need to draw the focus rectangle
     if (lpDrawItemStruct->itemState & ODS_FOCUS)
    {
       TRACE("*** Calling DrawFocusRect()   (drawing entire control)
***\n");
        dc.DrawFocusRect( &rcClientRect );
    }
 }
 else if( lpDrawItemStruct->itemAction == ODA_FOCUS )
 {
    TRACE("*** Calling DrawFocusRect()   (drawing focus rect only) ***\n");
    dc.DrawFocusRect( &rcClientRect );
 }

- When I double-click the checkbox (after I have focused on it by tabbing),
the first call to DrawFocusRect() gets executed twice (i.e. DrawItem() is
called twice with ODA_DRAWENTIRE and ODS_FOCUS).
- When I tab afterwards to change the focus, the second call to
DrawFocusRect executes once (i.e. DrawItem() is called once with ODA_FOCUS).

However, instead of erasing the focus rect; it makes it a deep, solid black
instead of erasing the existing rectangle--almost as if it was adding
another dithered rectangle to the existing focus rect, except offset just
enough to make it add to the existing rect instead of deleting it).

I have calls to SetCheck() both in OnKeyUp() (checking for space bar) and
OnLButtonUp(). Should I have some sort of overriden OnDoubleclicked() with
some workaround for my problem?

Thanks,
Silvio









0
slopes (29)
8/19/2003 3:18:27 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
1445 Views

Similar Articles

[PageSpeed] 8

Reply:

Similar Artilces:

Report Must be Clicked to Enlarged
I developed an application which runs several reports. When a report opened it remained minimized so I put a command in the open event of each report: DoCmd.Maximize This solved one problem, however, the report still does not fill the entire screen until the report is clicked after it is displayed. Is there a way to do this programatically so that when a report is opened, it not only maximizes, but fills the entire screen without the user having to click on it ? On Sat, 12 May 2007 08:38:00 -0700, rmcompute wrote: > I developed an application which runs several reports. When ...

Engineering Drawing
I would like to see a check box in the item Engineering Screen to indicate that the current Drawing Group and revision be attached to a PO line for the item during PO creation (and this attachment will NOT change if the current revision/drawings changes). An additional field in the PO line detail would show the attached drawing group, and allow for this to be changed for the item if required (such as an engineering purchase of a new rev, or a purchase of an old rev). The drawing group should be available in the Purchase Receipt detail, the Incoming Quality Module and other related s...

eraser function in word drawing mode
How do I edit a picture in word (eg: to erase part of the picture)? Is there a eraser function? if so how do I use it?? Hi, Click on the picture and the Picture toolbar should appear. You can turn the toolbar on manually using View > Toolbars > Picture. On the bottom row of the toolbar you'll find selection tools. Use an appropriate selection tool to select an area then use Edit > Cut to remove the selected part. -Jim Quoting from "lawengin" <skho@iinet.net.au>, in article 659b9c2c-f361-4f64-be3c-1e1fb2be6ce3@e32g2000prn.googlegroups.com, on [DATE: > How...

doubling up in budgets
I know a few other people have come across this... when I create an advanced budget using autobudget, I end up with several amounts doubled up when I check budget v spending. for example, my income is doubled up, even though it only shows up once in the budget setup. also, my monthly home loan payment, classed as debt, also shows up twice. werid thing is, it only does it for last month, not current month! "big al" <bigal@discussions.microsoft.com> wrote in message news:AD44A119-2B89-416E-A5AC-D19ECF3AAEC3@microsoft.com... >I know a few other people have come across t...

owner of databases
All, Currently, the database owner is set to the person (to the person’s login id - sql login or windows login) who creates the database. In almost all the cases, it is the DBA that creates the databases in our setup. So when “exec sp_help” is executed it lists all the databases on the server along with their owner. As a BEST PRACTICE, who should this owner be set to. The problem with leaving it on the individual users is that when the person quits and if his login is removed the owner shows up as NULL when sp_help is executed. Can it be set to “sa”? Thanks, rgn Ye...

Anyone else have a double Sears Account, Money 2005?
Money 2005 When I enter my Sears Credit card information for online update - two card accounts are created with the same amount, same account number. 1. SearsCard.com My Sears Card 2. SearsCard.com New Sears Premier Card My Sears Card When I try to delete one, Microsoft Money says that it will only delete both or none. Anyone else have this problem? I have installed the Money 2005 patch. This is the only credit card that does this. Any ideas? Greg In microsoft.public.money, Greg wrote: >Money 2005 > >When I enter my Sears Credit card information for online update - two...

PropertyPage and control drawing problem...
Hi I have a Property Sheet where I have three property pages. On the third property page I have a CListCtrl and several dynamically created Combo Boxes on the top of it (on the top of list control). If the third page is activated and then I change the control to another program (alt + tab) and then back --> I can't see any of those controls in my property page. If I click list control, I can see the row I just clicked but not all. How and when I should draw those controls again TIA -HS ...

Changing Account owner also changes contact owner (and activity owner)
Hi, When I change the owner of an account, CRM also changes the owner of the contacts within that account and changes the owner of the activities that are connected to the contact. Is this behavior by default? (I can't Imagine). Sanne This is the default behavior. This is a nice feature when you lose an employee and need to reassign that employees accounts and all their sub-records to a replacement. Have you tried sharing the account record in question? What is your goal by reassigning the account but not the other related records? - Scott www.easiintl.com Sanne wrote: > Hi, >...

Double Payment
Customer double paid on an invoice. I now have the credit sitting in the customer's account. We issued a return of the amount overpaid via charge card. How do reverse the original payment creating a debit memo to wash the customer's credit and have a negative amount in the Bank Deposit Entry module? One way to do this (if you don't have the customer refund module) is create a debit memo for the customer and apply to the over payment. Then enter a Bank Transaction to deduct that amount from your checkbook. The Deposit Entry module will be off by the amount of the Bank Tr...

Change owner of Contact to Account's owner
I need to update >3600 contacts so that the contact owner is the same as the account owner and then make sure it stays updated. Any ideas on how to make sure this happens? you need to write code.. 1 - write a tool that will read your contacts and set the owner to be the same as the account owner. This could be done in an unsupported fashion using SQL or in a supported fashion using the SDK 2 - assuming each contact created is linked to an account you could write a callout that reassigns each contact to the accounts owner some coding required ============================== John O&...

Owner's Manager JScript
I'd like to display Owner's Manager on the Sales Order. Everytime, either the form loads OR owner changes, I'd like to display the manager for that owner. Anyone can help me OR point in a right direction OR provide some sample code, that would be great. Thanks, VJ ...

Unable to send mail to mail recipient after right clicking
I need help... I am unable to send a file/message from my desktop. After I right click on a word or file doc, I go to the mail recipient and click.... NOTHING shows up. It use to show up to Microsoft Outlook and I could send/forward mail. What happenend??? How can I fix it??? In the control panel I go to the mail part and it seems that the personal folders are not there. Are they erased???? How can I get them back??? A notice that says_ outlook.pst is not there... What can I do?? ...

Re-assign owner
I need to re-assign ownership that involves many records (activities etc) and have done this using settings/ users before for infrequent users. However when running the re-assign for users that own many activities etc the system seems to hang. Is there a limit to re-assigning or should I just be very patient and run this outside work hours? thanks On Dec 26, 10:05=A0pm, Steve <St...@discussions.microsoft.com> wrote: > I need to re-assign ownership that involves many records (activities etc) = and > have done this using settings/ users before for infrequent users. However > ...

How can I draw a box and whisker diagram?
Jon Peltier has instructions for box and whisker charts: http://www.peltiertech.com/Excel/Charts/ComboCharts.html#BoxWhisker Statts wrote: -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

Using automation to remove items from a drawing
I have a group enclosed in a shape - the "enclosing" shapes part of the group. I want to take the group and ungroup them. After ungrouping I want to select the "enclosing" shape and delete it or move it or whatever.. Is there any way to use automation to select this enclosing shape? That is, any way besides iteratively moving and checking that I am "inisde" the shape? Thanks There are several ways to handle this, depending on what you want to do. 1) Before a shape is ungrouped you can cache the list of its contained shapes. such as: Public Sub UngroupSelect...

if a ComboBox is null in a Form, must not allow a checkbox to be t
I have a check box named: [Report] in a subform named:[lbl_ScrapDB_subform] also I have a Form with a ComboBox named: [shift_combo] what I want is this: if [shift_combo] is null then [Report] must not allow to be true, how do that? Thanks in advance. -- Lorenzo Díaz Cad Technician Well it depends on when you want some kind of action to take place. Do you have a button where to click on or should it be in the after update of the combo or what... Anyway I think you can use something like: me.report=not isnull(me.shiftcombo) This means that the report check will only be true if...

all account owners changed to same owner
CRM 1.2; server OS w2003, sql server 2000 Some time between Wednesday (16th) afternoon and Thursday (17th) afternoon, when it was first noticed, all accounts (30,000+) had the owner changed. Owners A, B and C each owned about 1/3 of the accounts, now all accounts are owned by owner C. This changed was made without changing the last modifiedon date. We are in the process of restoring from backup. We are at a loss as to how this happened. Has anyone had a similar experience? Thoughts anyone? Thanks, -- Jim Yeah Jim, Somebody or some (workflow or other) process changed them! Field...

Owner Draw controls....
Newbie here. Just warning you :-) Using VC 6... I've been trying to place an owner drawn combo box in a dialog, following instructions from a text. I created a derived class for my control. Since I want all the message map functions, I've placed the combo box on the dialog, and used its ID in the owner draw code. The text suggests using a "variable or pointer". I've tried adding a variable with the class wizard, and nothing happens. i.e., the control that I've placed is unaffected. Of course I attached a control variable of my derived class to the combobo...

Double-Click question
I have a function that is called by both WM_LBUTTONDOWN and WM_LBUTTONDBLCLK messages. However the double-click behavior seems to depend on the state of the system (what exactly I don't know). Can anyone speculate what might cause this? Could it be the time limit between clicks or could the state of the system reduce this time limit? (BTW, what is the limit normally set at?) Thanks, E-Jo Define "state of the system". The double-click behavior is independent of any other consideration of system state unless your code is dependent on the system state. The only thing that th...

how do I resize a drawing and all shapes in it?
I'm working with Visio for the first time. Now that I've finished my first drawing, I need to add another drawing of equal size to the same page. However, I made the first drawing so big that there is not enough room on the page to add another drawing of equal size. I would like to reduce the size of the drawing (and all shapes within it, of course) by about one-third. I have searched through all the menu options and there seems to be no way to do this. I tried copying the drawing and pasting it onto another page, hoping that the paste operation would allow a resize, but th...

Remove double quotes from text file
I have a macro that saves a csv file with only one cell with a value. The cell contains commas though so it saves it in the text file with quote around it. Ex: Cell contents: ,value,value,value,,, When the text file is open in notepad: ",value,value,value,,," Is there any way to get rid of the quotes and have it read exactly like it does when open in Excel? Have your macro save it as a .prn file instead of .csv. In the Save As dialog this is called Formatted text (space delimited)(*.prn). The code may look like this: ActiveWorkbook.SaveAs Filename:= _ &...

Outlook 2007 freezing uppon clicking 'To...'
Hi all, I have 2 installations with a strange behavior. When I click 'To...' in a new message Address Book is opening but after that Outlook is freezing and became a nonclickable one :( The same situation can repeat 25 time, and only 26th is good enough to choose from the address book. Any workaround? Thanks in advance This is a very common problem which Microsoft claims they cannot reproduce and therefore cannot solve. Anecdotal reports claim the following may help: 1. Look for and correct a corrupt address in the Contacts displayed in the Outlook Address Book (especially i...

CDialog doesn't draw itself
Hi I don't understand this. I created a Dialog App with one Button(IDC_GETIMAGE) for testing reasons. When you click on the button the following function is called: void CTest1Dlg::OnGetimage() { CDC* pDC = GetDC(); Print(pDC, PRF_CHILDREN | PRF_CLIENT | PRF_ERASEBKGND | PRF_NONCLIENT | PRF_OWNED); ReleaseDC(pDC); } This works perfect: the dialog "renders" itself into itself (for testing reasons). This means that the CDialog class supports the WM_PRINT message Then I created another Dialog App (title="Test2") with no controls on it. I compiled it, started it and ...

CTreeCtrl checkbox event
I'm using a CTreeCtrl with checkboxes next the items. What event can I trap to detect a change to a checkbox? http://support.microsoft.com/kb/261289/en Victor "GT" <ContactGT_remove_@hotmail.com> wrote in message news:45cca3ce$0$17333$c3e8da3@news.astraweb.com... > I'm using a CTreeCtrl with checkboxes next the items. What event can I > trap to detect a change to a checkbox? > ...

Account reassigned owner affects all child entities' owners
Please help, I am out of wits from some of these issues... When an Account is reassigned to a new owner, all child entities' owners automatically becomes the new owner. A number of my customers' business process is such that an Account can be owned by User A, but Cases under the Account can be created by other users within the same BU. I think this makes sense. But the problem with MSCRM is when User A, by reason of change of organisation or maybe resigning from the company, reassigns an Account under his/her charge to User B, all Cases and other child objects under this Accou...