资源描述:
《学历的年龄分布窗体设计和程序》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、学历的年龄分布窗体设计和程序unitCX_nlxl;interfaceusesSysUtils,WinTypes,WinProcs,Messages,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls,Neocmbox,Buttons,DB,DBTables,Grids,ExtCtrls,OleCtrls,chartfx3;typeTCX_NLXL_FORM=class(TForm)Bevel2:TBevel;Bevel4:TBevel;Grid1:TStringGrid;FB:TRadioButton;BL:TRadioButton;Q
2、uery1:TQuery;Query2:TQuery;BitBtn1:TBitBtn;XL:TNeoComboBox;Label1:TLabel;Bevel1:TBevel;ChartFX1:TChartFX;QX:TRadioButton;Database1:TDatabase;Query3:TQuery;procedureFormCreate(Sender:TObject);procedureXLListPick(Sender:TObject);procedureQXClick(Sender:TObject);procedureFBClick(Sender:TObject);pr
3、ocedureBLClick(Sender:TObject);procedureBitBtn1Click(Sender:TObject);procedureFormActivate(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varCX_NLXL_FORM:TCX_NLXL_FORM;procedureCreate_Self;implementationusesteam,Pubvar,YX_ZZJGT;{$R*.DFM}varj1,i,_temp,_max,ZRS,_TAG,yx,
4、temp1,temp2:Integer;{主程序通过调用该过程可动态创建学历的年龄分布子模块的form}procedureCreate_Self;beginApplication.CreateForm(TCX_NLXL_FORM,CX_NLXL_FORM);ifCX_NLXL_FORM.Tag=1thentryCX_NLXL_FORM.ShowModal;FinallyCX_NLXL_FORM.Release;endelseCX_NLXL_FORM.Release;end;{学历的年龄分布form创建时初始化}procedureTCX_NLXL_FORM.FormCreate(Sen
5、der:TObject);beginCX_NLXL_FORM.Tag:=0;_Tag:=2;_max:=1;{==设置网格Grid1,放入查询结果==================================}yx:=0;tryQuery1.open;{Query1中预定义的SQL语句:selectdistinctlr_ryjbxxj.xldm,xlfromuserid.lr_ryjbxxjlr_ryjbxxj,userid.lr_xldmlr_xldmwherer_ryjbxxj.xldm=lr_xldm.xldmandZGZTDM<'50'andCSRQisnotnullo
6、rderbyxldm}exceptonE:EDataBaseErrordoyx:=HandelException(E);elseraise;end;ifyx<>0Thenexit;Grid1.RowCount:=Query1.RecordCount+3;Grid1.Cells[1,0]:='大中专以上';Grid1.Cells[0,0]:='<=''13''';Grid1.Cells[1,1]:='高中,技校';Grid1.Cells[0,1]:='>=''14''andxldm<=''21''';Grid1.Cells[1,2]:='初中以下';Grid1.Cells[0,2]:=
7、'>=''22''';XL.Items.ADD('大中专以上');XL.Items.ADD('高中,技校');XL.Items.ADD('初中以下');ifTeam.allTrim(Query1.Fields[0].AsString)=''thenbeginQuery1.Next;fori:=3toGrid1.RowCount-2dobeginGrid1.Cells[0,i]:='='+''''+Query1.Fields[0].AsString+''''