Click the chapter Exercise: 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 //Select Chapter 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 (' Start with ' +qsesson+ ' Chapter '); Fansone.show; {$ENDIF} {$IFDEF MSWindows} Fansone.showmodal; {$ENDIF} End;end;
DELPHI xe5-8 pop-up list box for selection