Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Pete Sass
 To: Khurram Tahir
  Where is Khurram Tahir?
 Khurram Tahir
Subject: RE: Adding Checkbox to Grid Header
Thread ID: 331569 Message ID: 331572 # Views: 52 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Saturday, December 31, 2011 5:49:05 PM         

> Is there any way to add a CheckBox to Grid Header like we see in YahooMail etc.

Well not exactly as there is no real way to actually add a CheckBox into the Grid header itself.
However, there are two possible work-a-rounds for you to consider.

Method 1:
In VFP you can include a picture in the header "that looks like a check box - checked or unchecked". You can use the click event of the header to check and switch the picture from "checked.bmp" to "unchecked.bmp".

Method 2:
Actually overlay a CheckBox over the Grid Header. Now the problem with this is if you click a Grid Header the CheckBox will go behind the Grid object and then cannot be seen. To eliminate this issue in the click event of each Grid Header add in the following code:
Thisform.ChkDeleteAll.Refresh  && Where ChkDeleteAll is the name of your CheckBox.

You can size the CheckBox so it totally covers the Header where it is overlayed over so there is no chance for the user to click the Header under the CheckBox.
Pete "the IceMan", from the Great White North of Canada.


Adding Checkbox to Grid Header Posted by Khurram Tahir @ 12/31/2011 1:37:52 PM
RE: Adding Checkbox to Grid Header Posted by Pete Sass @ 12/31/2011 5:49:05 PM
RE: Adding Checkbox to Grid Header Posted by Stefan Wuebbe @ 1/1/2012 2:09:52 PM