MS FLEX Grid control (continued)

zhaozj2021-02-17  43

Corrected ::: Previous article www.vchelp.com should change to www.vchelp.net.

First, set the number of fixed lines and columns of the control, usually one. Then define the grid control. Let CGRID M_GRID; set the grid head.

Cstring sheading;

Sheading = _t ("Serial Number | User Name | Login Password"); m_grid.setFormatString (Sheading);

Then set the number of lines of mesh.

m_grid.setrows (ncurrows);

m_grid.setcols (ncurcols);

First set the grid unit position before setting the grid content.

m_grid.setrow (ncurrow); m_grid.setcol (ncurcol);

Set text alignment:

M_Grid.setcelLalignment (Short value);

The meanings are as follows

flexAlignLeftTop 0 The cell content is aligned left, top. flexAlignLeftCenter 1 Default for strings. The cell content is aligned left, center. flexAlignLeftBottom 2 The cell content is aligned left, bottom. flexAlignCenterTop 3 The cell content is aligned center, top. flexAlignCenterCenter 4 The cell content is aligned center, center. flexAlignCenterBottom 5 The cell content is aligned center, bottom. flexAlignRightTop 6 The cell content is aligned right, top. flexAlignRightCenter 7 Default for numbers. The cell content is aligned right, center. flexAlignRightBottom 8 The cell Content IS Aligned Right, Bottom. FlexAlignGeneral 9 The Cell Content IS of General Alignment. This is "Left, Center" for strings and "right, center" for number.

Then set the cell content.

m_grid.settext (CSTRING STR);

We can use the following functions to get the contents of the grid unit.

CString str = m_grid.getTextMatrix (ncurrow, ncurcol);

. . . . to be continued. . . .

转载请注明原文地址:https://www.9cbs.com/read-28900.html

New Post(0)