Jump to content

Recommended Posts

Posted

Hello,

I need to create a ToolButton in a TuniDBGrid at runtime, I'm trying to create it as follows:

  UniDBGrid1.ToolButtons.Add;
  UniDBGrid1.ToolButtons.Items[UniDBGrid1.ToolButtons.Count - 1].IconCls  := 'delete';
  UniDBGrid1.ToolButtons.Items[UniDBGrid1.ToolButtons.Count - 1].ButtonId := 1;
  UniDBGrid1.ToolButtons.Items[UniDBGrid1.ToolButtons.Count - 1].Visible  := true;

I have already checked with "count" if the button was created and the count indicated that it was, but it does not appear, I tried "refresh" and "repaint" but nothing happens, can someone help me?

 

uniGui version: 1.95.0 build 1595

Delphi version: 12.2 Patch 1

Posted

Hello,

At the moment, adding a ToolButton to a TUniDBGrid works only if it is done in the OnCreate event of the form, before the grid is rendered.

Posted

@Sherzod,

I used your information and created a component that instantiates the "ToolButton" in the "OnCreate" of the derived class.

It's not completely dynamic like creating at runtime, but it gives me flexibility and it worked for me.

Thanks

  • Upvote 1
  • Elvio changed the title to ToolButtons created at runtime do not appear [resolved]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...