We help IT Professionals succeed at work.
Get Started
Troubleshooting Question

Event Handler for a TreeView Checkbox

31 Views
Last Modified: 2020-12-29
I am using C++ Builder XE 10.1 Berlin Enterprise edition Update 2
I wish to code an event handler that is invoked when a checkbox in a TreeView is checked.
At present, I can only detect when a TreeView checkbox is checked or un-checked in the selected node by using the OnClick event handler whereas  I would prefer to handle a checkbox event without it having to select each node where a checkbox is selected.
My code is as follows which only works for the currently selected node
void __fastcall TForm1::TreeView1Click(TObject *Sender)
{
 bool   checked = false;
 checked = TreeView_GetCheckState(TreeView1->Handle,TreeView1->Selected->ItemId);
 Label3->Visible = checked;
}i
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE