點擊章節練習: var tmplm:Tlistboxitem; begin dm.FDQTMP.SQL.Clear; dm.FDQTMP.SQL.Add('select GSESSON from TSquestions where GLESSON=:ggl group by GSESSON'); dm.FDQTMP.Params.ParamByName('ggl').Value:=Qlesson; dm.FDQTMP.Open; dm.FDQTMP.First; ListBoxSesson.Items.Clear; ListBoxSesson.BeginUpdate; while not dm.FDQTMP.Eof do begin tmplm:=Tlistboxitem.Create(nil); tmplm.ItemData.Text:=dm.FDQTMP.FieldByName('GSESSON').AsString; tmplm.ItemData.Bitmap:=ImageYuan.Bitmap; tmplm.Parent:=ListBoxSesson; dm.FDQTMP.Next; end; ListBoxSesson.EndUpdate; popsesson.PlacementTarget:=Imagetop; popsesson.Placement:=TPlacement.plBottomCenter; popsesson.IsOpen:=true;
procedure TFmode.ListBoxSessonChange(Sender: TObject); begin //選擇章節 Qsesson:=ListBoxSesson.Items[ListBoxSesson.ItemIndex] ; popsesson.IsOpen:=false; if length(Qsesson)<>0 then begin Application.CreateForm(TFAnsOne, FAnsOne); {$IFDEF Android} FAnsOne.show; {$ENDIF} {$IFDEF IOS} SHOWMESSAGE('下面開始第'+Qsesson+'章練習'); FAnsOne.show; {$ENDIF} {$IFDEF MSWINDOWS} FAnsOne.showmodal; {$ENDIF} end; end;