Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox behavior using DropDown event
Message
From
08/10/2004 16:39:39
 
 
To
01/10/2004 13:04:47
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00947940
Message ID:
00950064
Views:
16
Thanks for the input Fabio, I used MouseEnter and it is working at the moment.
I added your solution to my useful tips project. I might revisit it if the
solution I used break.


>>Hi Fabio,
>>
>>I changed the container class from a Form to a Toolbar (my actual implementation) and it does not work anymore. Any ideas?
>>
>>
>>PUBLIC oform1,Choice
>>
>>Choice=0
>>
>>oform1=NEWOBJECT("form1")
>>oform1.Show
>>RETURN
>>
>>DEFINE CLASS form1 AS toolbar
>>
>>
>>	DoCreate = .T.
>>	Caption = "Form1"
>>	Name = "Form1"
>>
>>	ADD OBJECT optiongroup1 AS optiongroup WITH ;
>>		ControlSource = "m.Choice",;
>>		ButtonCount = 2, ;
>>		Value = 2, ;
>>		Height = 46, ;
>>		Left = 24, ;
>>		Top = 72, ;
>>		Width = 132, ;
>>		Name = "Optiongroup1", ;
>>		Option1.Caption = "Option1", ;
>>		Option1.Value = 0, ;
>>		Option1.Height = 17, ;
>>		Option1.Left = 5, ;
>>		Option1.Top = 5, ;
>>		Option1.Width = 61, ;
>>		Option1.Name = "Option1", ;
>>		Option2.Caption = "Option2", ;
>>		Option2.Value = 1, ;
>>		Option2.Height = 17, ;
>>		Option2.Left = 5, ;
>>		Option2.Top = 24, ;
>>		Option2.Width = 61, ;
>>		Option2.Name = "Option2"
>>
>>
>>	ADD OBJECT combo1 AS combobox WITH ;
>>		ColumnCount = 2, ;
>>		ColumnWidths = "100,200", ;
>>		Height = 24, ;
>>		Left = 192, ;
>>		Top = 72, ;
>>		Width = 100, ;
>>		Name = "Combo1",;
>>		Choice = 0,;
>>		RowSourceType = 3 ,;
>>		RowSource = "select * from test where f1= m.Choice into cursor cxxx"
>>
>>	PROCEDURE Init
>>		create cursor test (f1 i, f2 c(10))
>>		insert into test values (1, "Hello")
>>		insert into test values (1, "World")
>>		insert into test values (2, "How")
>>		insert into test values (2, "are")
>>		insert into test values (2, "you?")
>>	ENDPROC
>>
>>	PROCEDURE combo1.Gotfocus
>>		this.Requery()
>>	ENDPROC
>>
>>ENDDEFINE
>>
>
>A VFP's Toolbar is the genesis of the bugs,
>however if it appeals to the nature to you:
>
>PUBLIC oform1,Choice
>
>Choice=1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>DEFINE CLASS form1 AS toolbar
>
>	Caption = "TOOLBAR"
>	DATASESSION = 2
>	
>	ADD OBJECT optiongroup1 AS optiongroup WITH ;
>		ControlSource = "m.Choice",;
>		ButtonCount = 2, ;
>		Value = 2, ;
>		Height = 46, ;
>		Left = 24, ;
>		Top = 72, ;
>		Width = 132, ;
>		Name = "Optiongroup1", ;
>		Option1.Caption = "Option1", ;
>		Option1.Value = 0, ;
>		Option1.Height = 17, ;
>		Option1.Left = 5, ;
>		Option1.Top = 5, ;
>		Option1.Width = 61, ;
>		Option1.Name = "Option1", ;
>		Option2.Caption = "Option2", ;
>		Option2.Value = 1, ;
>		Option2.Height = 17, ;
>		Option2.Left = 5, ;
>		Option2.Top = 24, ;
>		Option2.Width = 61
>	
>
>	ADD OBJECT combo1 AS combobox WITH ;
>		ColumnCount = 2, ;
>		ColumnWidths = "100,200", ;
>		Left = 192, ;
>		Top = 72,;
>		RowSourceType = 3
>		
>	PROCEDURE combo1.Init
>		create cursor test (f1 i, f2 c(10))
>		insert into test values (1, "Hello")
>		insert into test values (1, "World")
>		insert into test values (2, "How")
>		insert into test values (2, "are")
>		insert into test values (2, "you?")
>		this.RowSource = "select * from test where f1= m.Choice into cursor cxxx"
>	ENDPROC
>
>	PROCEDURE combo1.MouseDown
>	LPARAMETERS nButton, nShift, nXCoord, nYCoord
>		this.Requery
>	ENDPROC
>	
>	PROCEDURE combo1.keyPress
>	LPARAMETERS nKeyCode, nShiftAltCtrl
>	* IF KEY OPEN LIST
>		this.Requery
>	* ENDIF
>	ENDPROC
>ENDDEFINE
>
>
>Fabio
ramil
~~ learning to stand still
Previous
Reply
Map
View

Click here to load this message in the networking platform