Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox little problem
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00512876
Message ID:
00512959
Views:
15
>>BUT if you add code to its GotFocus method, it always behave as if you have clicked in the text portion, no matter where you clicked, even if you have dodefault() on it. It works the same in VFP5 as in VFP6 SP5.
>>I need code in the getfocus and also I want the default functionality.
>
>Agustin,
>
>I'm not sure I understand exactly what you are having a problem with. The addition of code in the GotFocus method does not alter the behaviour of a combo box for me in any way. Can you explain in more detail and show the code in your GotFocus method?
>
>-Arne

Copy this to a program an run it, but never mind, the dodefault() was causing it. Thanks anyway.
oForm = create("cbotest")
oForm.visible = .t.
read events

**************************************************
DEFINE CLASS cbotest AS form
	Top = 0
	Left = 0
	Height = 229
	Width = 302
	DoCreate = .T.
	Caption = "Form1"
	Name = "asfdas"

	ADD OBJECT combo1 AS combobox WITH ;
		ColumnCount = 0, ColumnWidths = "", ;
		RowSourceType = 1, ;
		RowSource = "VFP 7.0,VFP 5.0,VFP 3.0,FP 2.6,FP 2.0,FoxBase", ;
		FirstElement = 1, Height = 24, ;
		Left = 144, NumberOfElements = 0, ;
		TabIndex = 2, Top = 37, ;
		Width = 100, Name = "Combo1"


	ADD OBJECT combo2 AS combobox WITH ;
		ColumnCount = 0, ColumnWidths = "", ;
		RowSourceType = 1, ;
		RowSource = "VFP 7.0,VFP 5.0,VFP 3.0,FP 2.6,FP 2.0,FoxBase", ;
		FirstElement = 1, Height = 24, ;
		Left = 144, NumberOfElements = 0, ;
		TabIndex = 4, Top = 85, ;
		Width = 100, Name = "Combo2"


	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, Left = 24, TabIndex = 1, Top = 36, Width = 100, Name = "Text1"


	ADD OBJECT text2 AS textbox WITH ;
		Height = 23, Left = 24, TabIndex = 3, Top = 84, Width = 100, Name = "Text2"


	ADD OBJECT label1 AS label WITH ;
		Caption = "Some code in GotFocus", ;
		Height = 17, Left = 145, Top = 69, Width = 144, Name = "Label1"


	ADD OBJECT label2 AS label WITH ;
		Caption = "No code in GotFocus", ;
		Height = 17, Left = 144, Top = 20, Width = 144, Name = "Label2"


	ADD OBJECT label3 AS label WITH ;
		WordWrap = .T., Alignment = 2, ;
		Caption = ("Click in text1, then click in the graphical portion of the combo 1 (no code in GotFocus). That's normal behavior."+chr(13)+chr(13)+"Now Click in text2 and then click in the graphical portion of Combo 2 (Some code in GotFocus). Different behavior."), ;
		Height = 110, Left = -1, FontName = "Tahoma",;
		Top = 120, Width = 305, ;
		BackColor = RGB(255,255,255), Name = "Label3"


	ADD OBJECT label4 AS label WITH ;
		Caption = "Text 1", Height = 17, ;
		Left = 26, Top = 18, Width = 40, Name = "Label4"


	ADD OBJECT label5 AS label WITH ;
		Caption = "Text 2", Height = 17, ;
		Left = 26, Top = 67, Width = 40, Name = "Label5"


	PROCEDURE QueryUnload
		clear events
	ENDPROC


	PROCEDURE combo2.GotFocus
		* this is all it takes!
		x = 1
		dodefault()
	ENDPROC


ENDDEFINE

...Y soy feliz, bien feliz, asi lo grito;
Mira, que el mundo sepa, que se sepa:
Soy feliz....                       

...And I'm happy, quite happy, so do I yell it;
Look, so the world knows it, so be known:
I'm happy...
 

Ismael Rivera "Oye cosita linda"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform