Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bill von Valtier
  
 Rochester
 
 Bill von Valtier
 To: Dale Dedoroy
  Where is Dale Dedoroy?
 Bacolod City, Negros Occidental
 Philippines
 Dale Dedoroy
 Tags
Subject: Thanks
Thread ID: 22341 Message ID: 22500 # Views: 0 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Sunday, April 20, 2003 1:06:45 PM         
   


> > > > Hello friends,
> > > >
> > > > If I put code into both the Click and the DblClick events of a control, when DblClick is done, the Click fires first (obviously because it's the first of two clicks, and it gets there first) preempting the DblClick. Commenting-out the Click event code allows the DblClick to fire. Changing the _DoubleClick system variable seems to make no difference.
> > > >
> > > > Is this by design (? maybe we're not supposed to use both in any one control?) or am I missing something?
> > > >
> > > > TIA
> > > >
> > > > BillvV
> > > > Rochester, Michigan
> > > See this as basic windowsbehavior.
> > > If you click on a control you select it and nothing happens. Dblclick on it and some action occurs.
> > > Therefore your finding that click and dblclick should not have event code in one control is right.
> > > This is one area where VFP8 shines with the bindevent() function in combination with unbindevents().
> > >
> > >
> > >
> > > Assume this:
> > > A form with a textbox and checkbox.
> > >
> > > When you click on the textbox you want something to happen.
> > > When you select a checkbox, you want the dblclick to react that way.
> > > In the init of the textbox place this code:
> > >
> > > BINDEVENT( this, "click", thisform, "clickme")
> > > 

> > >
> > > In the click event from the checkbox place this code.
> > >
> > > IF this.Value
> > > 	this.Caption = "DblClick"
> > > 	UNBINDEVENTS( thisform.text1,"click",thisform,"clickme")
> > > 	BINDEVENT( thisform.text1,"dblclick",thisform,"clickme")
> > > ELSE
> > > 	this.Caption = "Click"
> > > 	UNBINDEVENT( thisform.text1,"dblclick",thisform,"clickme")
> > > 	BINDEVENT( thisform.text1,"click",thisform,"clickme")
> > > ENDIF
> > > 

> > >
> > > The form has one method "Clickme"
> > > The high tech code there is:
> > >
> > > wait window nowait "Aw, you hit me hard... that hurts!!!"
> > > 

> > >
> > > When checked the click event is unbind and the dblclick is bound to that method.
> > > When unchecked the click is bound to the method and the dblclick is unbound.
> > >
> > > for those who want to see that code click here to download the file.
> > >
> > > Boudewijn LutgeĀ®ink
> > > Boudewijn.Lutgerink@foxite.com
> > > Experience is the knowledge you get immediately AFTER you actually needed it...
> >
> > Thanks BL,
> >
> > The fact that Click & DblClick aren't intended to be used together on the same control is what I needed to know so I could quit bashing my head against the brick wall.
> >
> > There are plenty of other brick walls available for me, so I don't need to waste my time on this one!!
> >
> > BillvV
>
> You can set the speed of clicking an doubleclicking thru windows control panel and select mouse.
>
> "Man's mind once stretched by a new idea never regains its original dimension."

Thanks for your input, Dale

I have played around with both the VFP _DblClick system variable and the Windows control panel and have been unable to find any way to work it out so than both can be used on the same control. The Windows control panel allows changing only the double click speed, not the click speed (that I have been able to find, that is). Have you ever been able to do this? Theoretically it should be possible, but on thinking about it, I guess one would have to always delay the Click event from firing for the duration of the length of the DblClick event before firing either one, and this was probably judged unacceptable by MS.

BillvV

COMPLETE THREAD

DblClick fires Click Posted by Bill von Valtier @ 4/16/2003 6:30:12 AM
RE: DblClick fires Click Posted by Boudewijn Lutgerink @ 4/16/2003 1:16:23 PM
RE: DblClick fires Click Posted by Bill von Valtier @ 4/17/2003 6:32:04 PM
RE: DblClick fires Click Posted by Dale Dedoroy @ 4/20/2003 12:11:58 PM
Thanks Posted by Bill von Valtier @ 4/20/2003 1:06:45 PM