DelphiDelphiVCLPythonPython GUIWindows

OnDrawCell Event in DelphiVCL Library

crop diverse women doing task in campus

OnDrawCell event Occurs when a cell in the grid needs to be drawn.

We write an OnDrawCell event handler to draw the contents of all the cells in the grid. Draw on the cell using the methods of the Canvas property. The Rect parameter indicates the location of the cell on the canvas. The Col and Row parameters indicate the column and row indexes of the cell that should be drawn. The State parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (nonscrolling) cell.

If the OnDrawCell event handler is not assigned, all cells in the draw grid will appear empty. If the DefaultDrawing property is True, the draw grid paints the background color of the cell before the OnDrawCell event and draws a focus rectangle around the selected cell after the OnDrawCell event handler finishes drawing the contents of the cell. If the DefaultDrawing property is False, the OnDrawCell event handler should paint the background of the cell and provide all visual indications of selection and focus.

Here is the working example of the implementation of an OnDrawCell event:

 

To see the result, let’s run the complete script:

1-8013913

 

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

close
Related posts
DelphiDelphiVCLPythonPython GUIWindows

What does the OnMessage Event in DelphiVCL.Application do?

Learn PythonPythonPython GUIVideos

Why You Should Debug Your Programs The Easy Way

Learn PythonPythonPython GUIWindows

What Are The Differences Between C++ and Python?

DelphiDelphiVCLPythonPython GUIWindows

What Is The Deallocates Method And What Does It Do?

Leave a Reply

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

en_USEnglish