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.

Related posts
CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And OpenCV Library?

CodeIDEProjectsPythonWindows

Unlock the Power of Python for Deep Learning with Radial Basis Function Networks (RBFNs)

CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And NumPy Library?

CodeIDEProjectsPythonWindows

Unlock the Power of Python for Deep Learning with Generative Adversarial Networks (GANs) - The Engine behind DALL-E

Leave a Reply

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