i want to create rdbtoolbar runtime, but cannot see images!

18 views
Skip to first unread message

enver penjo

unread,
Oct 21, 2025, 2:01:34 PMOct 21
to Rosi Delphi Components
procedure TForm2.FormCreate(Sender: TObject);
begin
var rDBToolBar1:=TrDBToolBar.create(self);
with rDBToolBar1 do begin
     rDBToolBar1.Parent:=self;
end;



end;

enver penjo

unread,
Oct 22, 2025, 8:33:19 AMOct 22
to Rosi Delphi Components
I manage it by myself.
unit Unit3;

interface

uses fr_dbtoolbar,Vcl.ImgList,dm_rdbaction, dm_rimages,rDBGrid, rDBGrid_MS,
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Vcl.Grids, Vcl.DBGrids;

type
  TForm3 = class(TForm)
    rDBGrid_MS1: TrDBGrid_MS;
    procedure FormCreate(Sender: TObject);
procedure EnsureRosiModules;
procedure EnsureImagesBar;
  private
FBar :TrDBToolBar;
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation


{$R *.dfm}

procedure TForm3.FormCreate(Sender: TObject);
begin
  FBar := TrDBToolBar.Create(Self);
  FBar.Parent := Self;
  EnsureRosiModules;
  EnsureImagesBar;
  rDBAction.SetActiveGrid(rDBGrid_MS1);
 
  //rDBGrid_MS1.DataSource:=    <-- set here your datasource
end;

procedure TForm3.EnsureRosiModules;
begin
  if rImages = nil then
    Application.CreateForm(TrImages, rImages);
  if rDBAction = nil then
    Application.CreateForm(TrDBAction, rDBAction);
end;

procedure TForm3.EnsureImagesBar;
var
  IL: TCustomImageList;
  C: TComponent;
begin
  if Assigned(rDBAction) and Assigned(rDBAction.ActList.Images) then
    FBar.rDBtbTool.Images := rDBAction.ActList.Images
  else
  if Assigned(rImages) then begin
    C := rImages.FindComponent('ImageList16');
    if C is TImageList then
    begin
      FBar.rDBtbTool.Images := TImageList(C);
      if Assigned(rDBAction) and (rDBAction.ActList.Images = nil) then
        rDBAction.ActList.Images := TImageList(C);
    end;
  end;
end;

end.

Reply all
Reply to author
Forward
0 new messages