Print Page | Close Window

Use CXTButton as push-like checkbox

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=1180
Printed Date: 29 April 2024 at 5:34am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Use CXTButton as push-like checkbox
Posted By: _dvr
Subject: Use CXTButton as push-like checkbox
Date Posted: 16 September 2004 at 3:48am

Hello!

 

Is it possible, to use CXTButton as push-like checkbox?

 

If set a state of button CHECKED, using

m_btn.SetStateX(TRUE);

The button is drawn correctly (pressed).

 

But if the user clicks on the pressed button, it is drawn not pressed, but not changing the state (i.e. GetCheck() == TRUE).

 

To solving this problem, I define ON_BN_CLICKED handler:

void CButtonDlg::OnButton1()

{

             m_btn.SetStateX(m_btn.GetChecked()); // for manual checkbox

             // or

             m_btn.SetStateX(!m_btn.GetChecked()); // for auto checkbox

}

Then the button is works correctly.

 

There is other way?

 




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