Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Tony Vignone
  Where is Tony Vignone?
 St Augustine
 Florida - United States
 Tony Vignone
 To: Muhammed Shafraz
  Where is Muhammed Shafraz?
 Colombo
 Sri Lanka
 Muhammed Shafraz
 Tags
Subject: RE: Select Multiple records by clicking Shif
Thread ID: 265087 Message ID: 268969 # Views: 29 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Thursday, July 15, 2010 6:30:00 PM         
   


> Dear Experts.
>
> Please consider the following scenario.
>
> Grid rows should able to be selected by using shift+hold and clicking the end of the range that needs to be selected
> Please help me on above requirement
> Please refer to the attached image for more details
>
> Thanks in advance
>

Put this in the MouseDown event in the check object or any another text object in a Column.
Cursor is called 'temp' and the checkbox field is call 'test'

		Thisform.LockScreen = .T.

		WITH This.Parent.Parent

		local rno
		rno = recno("temp")
		if nButton = 1 then		&& Left Button
			do case
			case nShift = 0		&& no ctrl key
				replace all test with 0 in "temp"
				go rno in "temp"
				.tag = str(rno)
			case nShift = 2		&& CTRL
				replace all test with 1 ;
					for recno("temp") = val(.tag) or recno("temp") = rno ;
					in "temp"
				go rno in "temp"
				.tag = str(recno("temp"))
			case nShift = 1		&& Shift
				if val(.tag) < recno("temp") then
					replace all test with 1 ;
						for val(.tag)<=recno("temp") and recno("temp")<=rno ;
						in "temp"
				else
					replace all test with 1 ;
						for rno<=recno("temp") and recno("temp")<=val(.tag) ;
						in "temp"
				endif
				go rno in "temp"
				.tag = str(rno)
			endcase
		endif	
					
		ENDWITH
		
		Thisform.LockScreen = .F.



ENTIRE THREAD

Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 6/18/2010 5:51:54 AM
RE: Select Multiple records by clicking Shif Posted by Samir H. @ 6/18/2010 6:45:15 AM
RE: Select Multiple records by clicking Shif Posted by Jun Tangunan @ 6/18/2010 6:50:28 AM
RE: Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 6/18/2010 8:07:28 AM
RE: Select Multiple records by clicking Shif Posted by Jun Tangunan @ 6/18/2010 8:37:42 AM
RE: Select Multiple records by clicking Shif Posted by tushar @ 6/18/2010 8:58:54 AM
RE: Select Multiple records by clicking Shif Posted by Yousfi Benameur @ 6/18/2010 11:39:02 AM
RE: Select Multiple records by clicking Shif Posted by Chris Chamberlain @ 6/18/2010 2:50:33 PM
RE: Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 7/15/2010 6:53:43 AM
RE: Select Multiple records by clicking Shif Posted by Chris Chamberlain @ 7/15/2010 8:56:24 AM
RE: Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 7/15/2010 9:07:27 AM
RE: Select Multiple records by clicking Shif Posted by Cetin Basoz @ 7/15/2010 12:46:56 PM
RE: Select Multiple records by clicking Shif Posted by Tony Vignone @ 7/15/2010 6:30:00 PM