Tech Tip: Utility method that set the grid size of a button grid
PRODUCT: 4D | VERSION: 13.0 | PLATFORM: Mac & Win
Published On: July 13, 2012
The grid size of a button grid is be set directly from the Object Property List or through the command name OBJECT SET FORMAT. The following method is a utility method which can be used in any project to set the grid size of a button grid during runtime.
` Method: SET_BUTTON_GRID_SIZE ` $1 - Pointer to the varaible set to a button grid ` $2 - Number of row ` $3 - Number of column C_POINTER($1;$button_p) C_LONGINT($2;$row_l) C_LONGINT($3;$col_l) C_TEXT($format_t) If (Count parameters>=3) $button_p:=$1 $row_l:=$2 $col_l:=$3 $format_t:=String($col_l)+";"+String($row_l) OBJECT SET FORMAT($button_p->;$format_t) End if |
Here is an example:
SET_BUTTON_GRID_SIZE (->Button Grid;5;7)
![](https://kb.4d.com:443/kbase/assets/images/76616-1.jpg)
SET_BUTTON_GRID_SIZE (->Button Grid;3;3)
![](https://kb.4d.com:443/kbase/assets/images/76616-2.jpg)