确定”按钮的单击事件代码: procedure TSelectDateForm.BtnOKClick(Sender: TObject); begin if RadioGroup1.ItemIndex<0 then begin application.MessageBox('您没有选择班次','提示:',mb_ok+mb_iconinformation); end else //if RadioGroup1.ItemIndex<0 then语句条件为假时开始 begin if not (WorkDataModForm.TabWork.Locate('日期','20'+datetimetostr(Calendar1.CalendarDate),[])) and (WorkDataModForm.TabWork.Locate('班次',RadioGroup1.Items.Strings[RadioGroup1.ItemIndex],[])) then begin workform.Label1.Caption:=inttostr(Calendar1.Year); workform.Label3.Caption:=inttostr(Calendar1.Month); workform.Label5.Caption:=inttostr(Calendar1.Day); if RadioGroup1.ItemIndex=0 then begin workform.Label7.Caption:=RadioGroup1.Items.Strings[RadioGroup1.ItemIndex]; workform.Label8.Left:=426; end; if RadioGroup1.ItemIndex=1 then begin workform.Label7.Caption:=RadioGroup1.Items.Strings[RadioGroup1.ItemIndex]; workform.Label8.Left:=426; end; if RadioGroup1.ItemIndex=2 then begin workform.Label7.Caption:=RadioGroup1.Items.Strings[RadioGroup1.ItemIndex]; workform.Label8.Left:=458; end; close; workform.ShowModal; end else Messagedlg(('数据库中已有'+'20'+datetostr(Calendar1.CalendarDate)+'日的'+RadioGroup1.Items.Strings[RadioGroup1.ItemIndex]+'班了,请选择其它日期或班次!'),mtinformation,[mbok],0); end; //if RadioGroup1.ItemIndex<0 then语句条件为假时结束(即此段代码全部结束) end; 我实在无法理解这是为什么,特请教诸位望尽快给我答复。 我的E-Mail:ref7667@hotmail.com 谢谢各位的帮助!!! 2003年6月25日
----------------------------------------------
-