Print Page | Close Window

clicking disabled button in toolbar?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7331
Printed Date: 12 November 2025 at 11:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: clicking disabled button in toolbar?
Posted By: Ashok
Subject: clicking disabled button in toolbar?
Date Posted: 08 June 2007 at 4:07am
Hi,
I have a problem when I am clicking the toolbar button. When I am going to click the disabled toolbar button I need to do the below code. But the commandbar doesn't supporting the code which is in red color (please see the below code). Is there is any alternate way in the commandbar code.
 
Note: Whenever I am going to click the disabled button it should not do anything.
 
The below code is in OnLButtonDown(...)

TOOLINFO ti = { 0 };

int nHit = OnToolHitTest( point, &ti );

int nDex = CommandToIndex( nHit );

if ( -1 < nDex && ( TBBS_DISABLED & GetButtonStyle( nDex )))

return;




Replies:
Posted By: Oleg
Date Posted: 08 June 2007 at 6:02am
Hi,
 
with CommandBars you need somthing like
CXTPControl* pControl = GetControls()->HitTest(point);
if (pControl && !pControl->GetEnabled())
    return;


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Ashok
Date Posted: 08 June 2007 at 6:19am
Hi Oleg,
   Many Thanks. It works.



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