Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stay on the same control when click the button!
Message
From
20/04/2005 17:25:08
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01006656
Message ID:
01006765
Views:
16
Vladimir, a little improvement
- visualEffects
- support shortcut key
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 24, ;
		Left = 256, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "\<Exec", ;
		TabStop = .F., ;
		Name = "Command1"


	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 44, ;
		Top = 44, ;
		Width = 100, ;
		Name = "Text1"


	ADD OBJECT text2 AS textbox WITH ;
		Height = 23, ;
		Left = 48, ;
		Top = 80, ;
		Width = 100, ;
		Name = "Text2"


	PROCEDURE command1.Click
		WAIT WINDOW "exec code"
	ENDPROC


	PROCEDURE command1.When
		PRIVATE oMouse,mouseEvent
		mouseEvent=MDOWN() AND AMOUSEOBJ(oMouse,1)=4 AND m.oMouse=m.This
		* mouseDown
		this.VisualEffect= 2
		thisform.Draw
		DO WHILE MDOWN()
			DOEVENTS
		ENDDO
		* mouseUp
		* this.VisualEffect= 1 && CHOICE 1
		* Click if Up within the Button
		IF NOT m.mouseEvent OR AMOUSEOBJ(oMouse,1)=4 AND m.oMouse=m.This
			this.Click
		ENDIF
		this.VisualEffect= 1 && CHOICE 2
		RETURN .f.
	ENDPROC


ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform