Mohammad Hamdan Posted October 7, 2013 Share Posted October 7, 2013 How to put an object in Cell like traditional StringGrid xxStringGrid.Object() := TObject(xx) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 11, 2013 Share Posted October 11, 2013 Hi Mohammad Hamdan. Try this: uses ... Vcl.Grids ... type TMyStringGrid = class (TUniStringGrid) FGrid: TStringGrid; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; end; { TMyStringGrid } constructor TMyStringGrid.Create(AOwner: TComponent); begin inherited; FGrid := TStringGrid.Create(nil); end; destructor TMyStringGrid.Destroy; begin FGrid.Free; inherited; end; Example: procedure TMainForm.UniButton1Click(Sender: TObject); var MyStringGrid: TMyStringGrid; begin MyStringGrid := TMyStringGrid.Create(Self); with MyStringGrid do begin Align := alTop; ColCount := 10; RowCount := 10; Parent := Self; end; MyStringGrid.Cells[1, 1] := 'Test'; MyStringGrid.FGrid.Objects[1, 1] := TObject(5); ShowMessage(IntToStr(Integer(MyStringGrid.FGrid.Objects[1, 1]))); end; Sincerely ... 1 Quote Link to comment Share on other sites More sharing options...
Mohammad Hamdan Posted October 12, 2013 Author Share Posted October 12, 2013 Hi duser Thank you so much, its works. So, when i want an extra properties for any uniGUI component, i can use this method. Quote Link to comment Share on other sites More sharing options...
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.