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