Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Setting focus programatically on TLMDDockPanel instance

edited May 2014 in LMD-Tools Vote Up0Vote Down
Hello,

ok i know its very simple, but i need to make a dockpanel active programatically (like you click on the caption of the dockpanel) but cannot.

Tried:

frmDevTree := TfrmDevTree.Create(self);
frmDevTree.Parent := LMDDP_DevTree;
frmDevTree.Align := alClient;
LMDDP_DevTree.SetFocus << i get the focus on the dockpanel, but also get a “Cannot focus a disabled or invisible window” message, so thats not a solution

Tried also... :

procedure Tmain.LMDDP_DevTreeShow(Sender: TObject);
begin
  LMDDP_DevTree.SetFocus;
end;

procedure Tmain.LMDDP_DevTreeShow(Sender: TObject);
begin
  LMDDP_DevTree.Activate;
end;

...but no luck.


Comments

  • 3 Comments sorted by Votes Date Added
  • Hi,

    I don't see any relation to dock panel in your code... 
    Btw, you can try to show dock panel before setting focus to its child, using standard Show method.
  • Hi,

    yes i did not refer to the dockpanel in the event handlers, i edited the code (yet it does not set focus on the dock panel).

    But yes, show method helped, so...:

      frmDevTree := TfrmDevTree.Create(self);
      frmDevTree.Parent := LMDDP_DevTree;
      frmDevTree.Align := alClient;
      LMDDP_DevTree.Show;
      LMDDP_DevTree.SetFocus;

    ...is working. Thank You.

Sign In or Register to comment.