Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More Fun With VFP
Message
From
28/06/2000 13:38:56
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
More Fun With VFP
Miscellaneous
Thread ID:
00385918
Message ID:
00385918
Views:
52
Hey folks,

This code comes to me from a young (did I say very young?) UT member who, apparently, wishes to remain anonymous, but if you say his first and last name together really fast, it sounds like the Union general who led the Peninsular campaign in 1862.

Try it!
oForm = createobject('lennontrib')
oForm.Show()
READ EVENTS
DEFINE CLASS lennontrib AS form
	Top = 0
	Left = 0
	Height = 574
	Width = 793
	DoCreate = .T.
	Caption = "Form3"
	WindowState = 2
	Name = "lennontrib"
	ADD OBJECT text1 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 14, ;
		Height = 23, ;
		Left = 48, ;
		Top = 24, ;
		Width = 100, ;
		Name = "Text1"
	ADD OBJECT text2 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 23, ;
		Left = 36, ;
		Top = 72, ;
		Width = 100, ;
		Name = "Text2"
	ADD OBJECT text3 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 11, ;
		Height = 23, ;
		Left = 480, ;
		Top = 120, ;
		Width = 100, ;
		Name = "Text3"
	ADD OBJECT text4 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 13, ;
		Height = 13, ;
		Left = 432, ;
		Top = 60, ;
		Width = 25, ;
		Name = "Text4"
	ADD OBJECT text5 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 23, ;
		Left = 240, ;
		Top = 144, ;
		Width = 100, ;
		Name = "Text5"
	ADD OBJECT text6 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 73, ;
		Left = 204, ;
		Top = 240, ;
		Width = 14, ;
		Name = "Text6"
	ADD OBJECT text7 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 265, ;
		Left = 240, ;
		Top = 84, ;
		Width = 313, ;
		Name = "Text7"
	ADD OBJECT text8 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 13, ;
		Height = 4, ;
		Left = 60, ;
		Top = 276, ;
		Width = 16, ;
		Name = "Text8"
	ADD OBJECT text9 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 23, ;
		Left = 132, ;
		Top = 144, ;
		Width = 100, ;
		Name = "Text9"
	ADD OBJECT text10 AS textbox WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 37, ;
		Left = 576, ;
		Top = 504, ;
		Width = 217, ;
		Name = "Text10"
	ADD OBJECT check1 AS checkbox WITH ;
		Tag = "0", ;
		Top = 216, ;
		Left = 600, ;
		Height = 121, ;
		Width = 73, ;
		FontSize = 12, ;
		Caption = "Check1", ;
		Name = "Check1"
	ADD OBJECT check2 AS checkbox WITH ;
		Tag = "0", ;
		Top = 408, ;
		Left = 360, ;
		Height = 17, ;
		Width = 60, ;
		FontSize = 14, ;
		Caption = "Check2", ;
		Name = "Check2"
	ADD OBJECT check3 AS checkbox WITH ;
		Tag = "0", ;
		Top = 408, ;
		Left = 336, ;
		Height = 1, ;
		Width = 13, ;
		FontSize = 12, ;
		Caption = "Check3", ;
		Name = "Check3"
	ADD OBJECT check4 AS checkbox WITH ;
		Tag = "0", ;
		Top = 360, ;
		Left = 144, ;
		Height = 1, ;
		Width = 13, ;
		FontSize = 10, ;
		Caption = "Check4", ;
		Name = "Check4"
	ADD OBJECT check5 AS checkbox WITH ;
		Tag = "0", ;
		Top = 204, ;
		Left = 72, ;
		Height = 17, ;
		Width = 60, ;
		FontSize = 13, ;
		Caption = "Check5", ;
		Name = "Check5"
	ADD OBJECT check6 AS checkbox WITH ;
		Tag = "0", ;
		Top = 36, ;
		Left = 312, ;
		Height = 17, ;
		Width = 60, ;
		FontSize = 13, ;
		Caption = "Check6", ;
		Name = "Check6"
	ADD OBJECT check7 AS checkbox WITH ;
		Tag = "0", ;
		Top = 552, ;
		Left = 12, ;
		Height = 17, ;
		Width = 60, ;
		FontSize = 14, ;
		Caption = "Check7", ;
		Name = "Check7"
	ADD OBJECT check8 AS checkbox WITH ;
		Tag = "0", ;
		Top = 408, ;
		Left = 72, ;
		Height = 17, ;
		Width = 60, ;
		FontSize = 12, ;
		Caption = "Check8", ;
		Name = "Check8"
	ADD OBJECT check9 AS checkbox WITH ;
		Tag = "0", ;
		Top = 288, ;
		Left = 36, ;
		Height = 1, ;
		Width = 13, ;
		FontSize = 11, ;
		Caption = "Check9", ;
		Name = "Check9"
	ADD OBJECT check10 AS checkbox WITH ;
		Tag = "0", ;
		Top = 168, ;
		Left = 36, ;
		Height = 17, ;
		Width = 67, ;
		FontSize = 10, ;
		Caption = "Check10", ;
		Name = "Check10"
	ADD OBJECT check11 AS checkbox WITH ;
		Tag = "0", ;
		Top = 432, ;
		Left = 564, ;
		Height = 17, ;
		Width = 67, ;
		FontSize = 12, ;
		Caption = "Check11", ;
		Name = "Check11"
	ADD OBJECT combo1 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 13, ;
		Height = 13, ;
		Left = 576, ;
		Top = 12, ;
		Width = 1, ;
		Name = "Combo1"
	ADD OBJECT combo2 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 11, ;
		Height = 24, ;
		Left = 240, ;
		Top = 444, ;
		Width = 100, ;
		Name = "Combo2"
	ADD OBJECT combo3 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 84, ;
		Top = 348, ;
		Width = 100, ;
		Name = "Combo3"
	ADD OBJECT combo4 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 14, ;
		Height = 24, ;
		Left = 48, ;
		Top = 240, ;
		Width = 100, ;
		Name = "Combo4"
	ADD OBJECT combo5 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 13, ;
		Height = 24, ;
		Left = 12, ;
		Top = 108, ;
		Width = 100, ;
		Name = "Combo5"
	ADD OBJECT combo6 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 24, ;
		Left = 192, ;
		Top = 12, ;
		Width = 100, ;
		Name = "Combo6"
	ADD OBJECT combo7 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 24, ;
		Left = 708, ;
		Top = 120, ;
		Width = 100, ;
		Name = "Combo7"
	ADD OBJECT combo8 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 241, ;
		Left = 504, ;
		Top = 192, ;
		Width = 253, ;
		Name = "Combo8"
	ADD OBJECT combo9 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 11, ;
		Height = 24, ;
		Left = 660, ;
		Top = 72, ;
		Width = 100, ;
		Name = "Combo9"
	ADD OBJECT combo10 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 14, ;
		Height = 24, ;
		Left = 192, ;
		Top = 528, ;
		Width = 100, ;
		Name = "Combo10"
	ADD OBJECT combo11 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 72, ;
		Top = 468, ;
		Width = 100, ;
		Name = "Combo11"
	ADD OBJECT combo12 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 13, ;
		Height = 13, ;
		Left = 216, ;
		Top = 396, ;
		Width = 13, ;
		Name = "Combo12"
	ADD OBJECT combo13 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 37, ;
		Left = 288, ;
		Top = 384, ;
		Width = 25, ;
		Name = "Combo13"
	ADD OBJECT combo14 AS combobox WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 24, ;
		Left = 240, ;
		Top = 384, ;
		Width = 100, ;
		Name = "Combo14"
	ADD OBJECT spinner1 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 37, ;
		Left = 564, ;
		Top = 132, ;
		Width = 85, ;
		Name = "Spinner1"
	ADD OBJECT spinner2 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 11, ;
		Height = 181, ;
		Left = 360, ;
		Top = 360, ;
		Width = 61, ;
		Name = "Spinner2"
	ADD OBJECT spinner3 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 25, ;
		Left = 48, ;
		Top = 168, ;
		Width = 37, ;
		Name = "Spinner3"
	ADD OBJECT spinner4 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 1, ;
		Left = 156, ;
		Top = 84, ;
		Width = 13, ;
		Name = "Spinner4"
	ADD OBJECT spinner5 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 1, ;
		Left = 492, ;
		Top = 24, ;
		Width = 97, ;
		Name = "Spinner5"
	ADD OBJECT spinner6 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 37, ;
		Left = 576, ;
		Top = 60, ;
		Width = 49, ;
		Name = "Spinner6"
	ADD OBJECT spinner7 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 25, ;
		Left = 468, ;
		Top = 48, ;
		Width = 73, ;
		Name = "Spinner7"
	ADD OBJECT spinner8 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 13, ;
		Height = 25, ;
		Left = 408, ;
		Top = 516, ;
		Width = 25, ;
		Name = "Spinner8"
	ADD OBJECT spinner9 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 13, ;
		Height = 85, ;
		Left = 480, ;
		Top = 467, ;
		Width = 61, ;
		Name = "Spinner9"
	ADD OBJECT spinner10 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 11, ;
		Height = 37, ;
		Left = 420, ;
		Top = 360, ;
		Width = 37, ;
		Name = "Spinner10"


	ADD OBJECT spinner11 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 12, ;
		Height = 13, ;
		Left = 372, ;
		Top = 12, ;
		Width = 13, ;
		Name = "Spinner11"


	ADD OBJECT spinner12 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 11, ;
		Height = 1, ;
		Left = 660, ;
		Top = 24, ;
		Width = 61, ;
		Name = "Spinner12"


	ADD OBJECT spinner13 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 10, ;
		Height = 85, ;
		Left = 768, ;
		Top = 276, ;
		Width = 1, ;
		Name = "Spinner13"


	ADD OBJECT spinner14 AS spinner WITH ;
		Tag = "0", ;
		FontSize = 11, ;
		Height = 1, ;
		Left = 624, ;
		Top = 492, ;
		Width = 49, ;
		Name = "Spinner14"


	ADD OBJECT command1 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 48, ;
		Left = 180, ;
		Height = 85, ;
		Width = 25, ;
		FontSize = 10, ;
		Caption = "Command1", ;
		Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 36, ;
		Left = 360, ;
		Height = 25, ;
		Width = 49, ;
		FontSize = 12, ;
		Caption = "Command2", ;
		Name = "Command2"


	ADD OBJECT command3 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 36, ;
		Left = 480, ;
		Height = 37, ;
		Width = 25, ;
		FontSize = 13, ;
		Caption = "Command3", ;
		Name = "Command3"


	ADD OBJECT command4 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 240, ;
		Left = 312, ;
		Height = 37, ;
		Width = 97, ;
		FontSize = 12, ;
		Caption = "Command4", ;
		Name = "Command4"


	ADD OBJECT command5 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 324, ;
		Left = 96, ;
		Height = 13, ;
		Width = 168, ;
		FontSize = 14, ;
		Caption = "Command5", ;
		Name = "Command5"


	ADD OBJECT command6 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 216, ;
		Left = 60, ;
		Height = 13, ;
		Width = 1, ;
		FontSize = 12, ;
		Caption = "Command6", ;
		Name = "Command6"


	ADD OBJECT command7 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 144, ;
		Left = 48, ;
		Height = 37, ;
		Width = 1, ;
		FontSize = 11, ;
		Caption = "Command7", ;
		Name = "Command7"


	ADD OBJECT command8 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 60, ;
		Left = 60, ;
		Height = 25, ;
		Width = 13, ;
		FontSize = 10, ;
		Caption = "Command8", ;
		Name = "Command8"


	ADD OBJECT command9 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 216, ;
		Left = 336, ;
		Height = 25, ;
		Width = 25, ;
		FontSize = 13, ;
		Caption = "Command9", ;
		Name = "Command9"


	ADD OBJECT command10 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 372, ;
		Left = 492, ;
		Height = 37, ;
		Width = 25, ;
		FontSize = 12, ;
		Caption = "Command10", ;
		Name = "Command10"


	ADD OBJECT command11 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 456, ;
		Left = 312, ;
		Height = 37, ;
		Width = 73, ;
		FontSize = 11, ;
		Caption = "Command11", ;
		Name = "Command11"


	ADD OBJECT command12 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 420, ;
		Left = 0, ;
		Height = 25, ;
		Width = 13, ;
		FontSize = 11, ;
		Caption = "Command12", ;
		Name = "Command12"


	ADD OBJECT command13 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 300, ;
		Left = 36, ;
		Height = 37, ;
		Width = 13, ;
		FontSize = 10, ;
		Caption = "Command13", ;
		Name = "Command13"


	ADD OBJECT command14 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 156, ;
		Left = 12, ;
		Height = 37, ;
		Width = 25, ;
		FontSize = 10, ;
		Caption = "Command14", ;
		Name = "Command14"


	ADD OBJECT command15 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 48, ;
		Left = 12, ;
		Height = 13, ;
		Width = 1, ;
		FontSize = 13, ;
		Caption = "Command15", ;
		Name = "Command15"


	ADD OBJECT command16 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 84, ;
		Left = 492, ;
		Height = 1, ;
		Width = 13, ;
		FontSize = 13, ;
		Caption = "Command16", ;
		Name = "Command16"


	ADD OBJECT command17 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 156, ;
		Left = 708, ;
		Height = 1, ;
		Width = 13, ;
		FontSize = 11, ;
		Caption = "Command17", ;
		Name = "Command17"


	ADD OBJECT command18 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 468, ;
		Left = 720, ;
		Height = 1, ;
		Width = 37, ;
		FontSize = 10, ;
		Caption = "Command18", ;
		Name = "Command18"


	ADD OBJECT command19 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 504, ;
		Left = 576, ;
		Height = 1, ;
		Width = 37, ;
		FontSize = 10, ;
		Caption = "Command19", ;
		Name = "Command19"


	ADD OBJECT command20 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 528, ;
		Left = 300, ;
		Height = 37, ;
		Width = 49, ;
		FontSize = 11, ;
		Caption = "Command20", ;
		Name = "Command20"


	ADD OBJECT command21 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 444, ;
		Left = 132, ;
		Height = 49, ;
		Width = 49, ;
		FontSize = 11, ;
		Caption = "Command21", ;
		Name = "Command21"


	ADD OBJECT command22 AS commandbutton WITH ;
		Tag = "0", ;
		Top = 168, ;
		Left = 720, ;
		Height = 49, ;
		Width = 37, ;
		FontSize = 14, ;
		Caption = "Command22", ;
		Name = "Command22"


	ADD OBJECT timer1 AS timer WITH ;
		Tag = "0", ;
		Top = 36, ;
		Left = 636, ;
		Height = 23, ;
		Width = 23, ;
		Interval = 250, ;
		Name = "Timer1"


	PROCEDURE Init
		for each loControl in thisform.controls
			loControl.Tag = tran(int(rand() * 100))
		endfor
	ENDPROC


	PROCEDURE timer1.Timer
		for each loControl in thisform.controls
			loControl.Left = loControl.Left + val(loControl.Tag)
			if loControl.Left < 0 or loControl.Left + loControl.width > thisform.width
				loControl.Tag = tran(val(loControl.Tag) * -1)
			endif
		endfor
		if thisform.command1.caption = 'Number 9'
			thisform.setall('caption', '', 'commandbutton')
			thisform.setall('caption', '', 'checkbox')
			thisform.setall('value', '', 'textbox')
			thisform.setall('displayvalue', '', 'combobox')
		else
			thisform.setall('caption', 'Number 9', 'commandbutton')
			thisform.setall('caption', 'Number 9', 'checkbox')
			thisform.setall('value', 'Number 9', 'textbox')
			thisform.setall('displayvalue', 'Number 9', 'combobox')
		endif
	ENDPROC


ENDDEFINE
*
*-- EndDefine: lennontrib
**************************************************
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Next
Reply
Map
View

Click here to load this message in the networking platform