Home About us Development Training Support |
Adding a checkbox to a Foxpro gridA column in a grid can hold any other control - even a large and complex container such as a pageframe or another grid. A simple example is to replace the textbox with a checkbox as shown in the example below:
The technique to replace the textbox with another control is simple, but not obvious. The problem is that you seem to have no way of selecting the textbox on screen so that you can delete it. The trick is to use the Properties Window to make that selection:
Adding a control from a custom libraryWhen you are adding controls to a form you have the alternatives of clicking on the Form Controls toolbar or dragging a control from a class library on the Classes tab of the Project Manager. This second option does not work when you are trying to add a control to a grid. Use the technique described here to show the custom controls on the toolbar. Aligning the checkboxBy default the chackbox will appear against the left-hand edge of the column. This is usually wrong. The grid in VFP 9 has a new property which lets you set the alignment of the control in the column. In earlier versions the workaround is to centre the checkbox manually inside a container and then add the container to the column. The container itself will be left-justified but if the container is made transparent and borderless then the checkbox will appear to be centred. Highlighting the selected rowsIn this example the customer wanted a really clear way of seeing which entries had been selected. The grid's DynamicForeColor property allowed me to grey out those rows which were not selected. |
Hints & tips
The textbox class in Visual FoxPro 9 has a new Autocomplete
property which shows the user the previous values that have
been entered in that textbox.
More...
|