Elvio Posted May 19, 2025 Posted May 19, 2025 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 Quote
Sherzod Posted May 20, 2025 Posted May 20, 2025 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. Quote
Elvio Posted May 26, 2025 Author Posted May 26, 2025 @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 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.