delphi - TTaskBar - Show another form with TaskBarButtons -
i use delphi xe6 : create taskbarbutton in taskbar. button linked on action make :
tform2.create(nil).showmodal;
the form2 showing without focus. , sometimes, complex form, new form appears behind application , have click anywhere see it.
why haven't focus on new form created taskbutton ? (if click on simple button, new form have focus).
code in mainform :
unit unit1; interface uses winapi.windows, winapi.messages, system.sysutils, system.variants, system.classes, vcl.graphics, vcl.controls, vcl.forms, vcl.dialogs, unit2, system.actions, vcl.actnlist, system.win.taskbarcore, vcl.taskbar; type tform1 = class(tform) actionlist1: tactionlist; action1: taction; taskbar1: ttaskbar; procedure action1execute(sender: tobject); private { déclarations privées } public { déclarations publiques } end; var form1: tform1; implementation {$r *.dfm} procedure tform1.action1execute(sender: tobject); var formtest : tform2; begin try //self.enabled := false; formtest := tform2.create(nil); formtest.showmodal; formtest.free; //self.enabled := true; end; end; end.
tform2 new form component.
Comments
Post a Comment