DelphiDelphiVCLPythonPython GUIWindows

How to use the State Property

man sitting cozy while working on his laptop

State property is used as an indicator for which items are selected or checked.

For example, for each member of the Items array, we use State to determine whether the checkbox is selected (cbChecked), cleared (cbUnchecked), or dimmed (cbGrayed). 

Note: cbGrayed corresponds to the indeterminate state.

State combines the information provided by the Boolean Checked property and the Boolean ItemEnabled property:

  • When Checked is True, State is cbChecked. However, when Checked is False, State may be either cbUnchecked or cbGrayed.
  • When State is cbGrayed, ItemEnabled is False. However, ItemEnabled may also be False when State is cbUnchecked or cbChecked.)

Another example of a State use case is in Draw Grid creation. State will show us the selected cell in the created grid or table. 

Here is the working example of the implementation of State in Draw Grid creation:

See the complete code here.

The result:

2-4199814
3-6313460

 

Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.

close
Related posts
DelphiDelphiVCLPythonPython GUIWindows

Creating A New Application With DelphiVCL.Application.Create

DelphiDelphiVCLPythonPython GUIWindows

All You Need To Know About Application.DialogHandle

DelphiDelphiVCLPythonPython GUIWindows

What is the FieldAddress Property in DelphiVCL.Application?

DelphiDelphiVCLPythonPython GUIWindows

What is the FindComponent Property in DelphiVCL.Application?

Leave a Reply

Your email address will not be published. Required fields are marked *

en_USEnglish