Log In    |    Knowledge Base    |    4D Home
Tech Tip: 4D v6.5: Creating buttons in the header of output forms
Published On: June 4, 1999

One limitation of 4D has been that you could only put buttons in the footer area of an output form. 4D version 6.5 adds many new enhancements to the user interface including the ability to now create buttons in the header area of an output form as well. One use for this would be to add sort buttons at the top of each column on an output form. This can be done using the following procedure:

1. Rename the column headings static text object to something meaningful such as "Name" and "Age".
2. Create invisible buttons and place them over the static text of the column.
3. Add the following code to the first invisible button:

Object Method: bName
If (Form event=On Clicked)
FONT STYLE(*;"Name";4)
FONT STYLE(*;"Age";0)
ORDER BY([Table 1]Name;>)
End if

4. Add the following code to the second invisible button:

` Object Method: bAge
If (Form event=On Clicked)
FONT STYLE(*;"Age";4)
FONT STYLE(*;"Name";0)
ORDER BY([Table 1]Age;>)
End if

5. Repeat the above procedure for each additional column you wish to add.
For more information on using active objects in the header, see page 46 of the 4D 6.5 Upgrade documentation.