[找错]编程方式加载的控件属性和事件不执行,不知错在何处?
程序代码:
IF !USED("export_fa") USE export_fa EXCLUSIVE ENDIF IF !USED("test") USE test EXCLUSIVE ENDIF frm_Test = CREATEOBJECT("Form") WITH frm_Test .AutoCenter = .T. .Top = 0 .Left = -1 .Height = 786 .Width = 1233 .Caption = "2014车辆调度系统" .Name = "Form1" .AddObject("grdFind", "gridclass1") WITH .grdFind .Visible = .T. .Height = 200 .Left = 12 .Panel = 1 .Top = 12 .Width = 1212 .HighlightBackColor = RGB(46,74,153) .HighlightStyle = 2 .Name = "grdFind" .AllowCellSelection=.F. .ColumnCount=12 .LockColumns=2 .DeleteMark=.F. .RecordMark=.F. .GridLineColor=Rgb(192,192,192) .Column1.Header1.Caption="司机安排" .Column1.Width=55 .Column1.BackColor=Rgb(249,249,244) .Column2.Header1.Caption="车辆安排" .Column2.Width=55 ********此段增加cbocar的代码有什么问题,为何combo控件不能下拉出数据 .Column2.AddObject("cbocar", "cbocarclass1") .Column2.CurrentControl="cbocar"&&设为当前 WITH .Column2.cbocar .rowsourcetype=1 .rowsource='a,b,c,d' *!* .GotFocus &&如何让此处代码执行 .enabled=.t. .visible=.t. ENDWITH ******** .Column2.BackColor=Rgb(249,249,244) .Column3.Header1.Caption="使用车型" .Column3.Header1.BackColor=RGB(255,0,0) .Column3.Width=60 .Column4.Header1.Caption="事由" .Column4.Width=30 .Column5.Header1.Caption="用车单位" .Column5.Width=80 .Column6.Header1.Caption="用车时间" .Column6.Width=100 .Column7.Header1.Caption="结束时间" .Column7.Width=100 .Column8.Header1.Caption="出发地" .Column8.Width=50 .Column9.Header1.Caption="目的地" .Column9.Width=50 .Column10.Header1.Caption="人数" .Column10.Width=10 .Column11.Header1.Caption="驻" .Column11.Width=15 .Column12.Header1.Caption="备注" .Column12.Width=100 .SetAll("DynamicForeColor","IIF(ALLTRIM(test.出车事由)='会议',RGB(0,0,0),; IIF(ALLTRIM(test.出车事由)='培训',RGB(0,128,0),RGB(255,0,0)))","Column") .Column1.ControlSource="test.状态" .Column2.ControlSource="test.回退原因" .Column3.ControlSource="test.使用车型" .Column4.ControlSource="test.出车事由" .Column5.ControlSource="test.用车单位" .Column6.ControlSource="test.用车时间" .Column7.ControlSource="test.结束时间" .Column8.ControlSource="test.出发地点" .Column9.ControlSource="test.目的地" .Column10.ControlSource="test.用车人数" .Column11.ControlSource="test.过夜" .Column12.ControlSource="test.备注" ENDWITH .Show(1) ENDWITH RETURN * 父類定義 DEFINE CLASS gridclass1 AS grid PROCEDURE Init public aa Thisform.Refresh ENDPROC PROCEDURE AfterRowColChange LPARAMETERS nColIndex thisform.Refresh&&为了同步刷新 ENDPROC ENDDEFINE DEFINE CLASS cbocarclass1 AS combobox PROCEDURE GotFocus *!* 按申请记录使用车型加载人车数据 this.RowSourceType= 1 this.RowSource='a,b,c,d'&&'select export_fa.assetname,export_fa.custodian from export_fa where export_fa.assettype=test.使用车型 into cursor temp ORDER BY export_fa.assetname ASC' MESSAGEBOX("按申请记录使用车型加载人车数据") ENDPROC ENDDEFINE