Print Page | Close Window

How to stop ComboBox Click event?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=24076
Printed Date: 20 April 2024 at 6:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to stop ComboBox Click event?
Posted By: jquerijero
Subject: How to stop ComboBox Click event?
Date Posted: 29 September 2020 at 2:58pm
When typing ahead, I want to suspend the Click (SelectionChanged) event and only fire it when tabbing out of the control.



Replies:
Posted By: rdhd
Date Posted: 02 October 2020 at 5:33pm
Did you try a simple subclass approach and trap the CBN_SELCHANGE notification by overriding WindowProc, which is virtual? You can decide to ignore the notification or not.

One approach would be to subclass the windows control GetClassInfo and RegisterClass. Then in your own window proc (or message map if using MFC), you can ignore the sel changed message using a method to turn it off and on.

Once registered you can drop it on a dialog using the custom control in the toolbox or you can use SubClassDlgItem and to swap out the control using code when the dialog is created.

Either way, you have to be careful about what to do if the CBN_DROPDOWN message arrives as users can arrow down and enter or just move down and click an item.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net