asapltda Posted July 9, 2021 Share Posted July 9, 2021 Good morning gentlemen, good morning gentlemen, how to change the font in a unidbgrid and / or an unimdbgrid in runtime? thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 9, 2021 Share Posted July 9, 2021 Hello, One possible solution, you can use OnDrawColumnCell event for this. Quote Link to comment Share on other sites More sharing options...
asapltda Posted July 9, 2021 Author Share Posted July 9, 2021 Thank you for your answer Mr. Sherzod, but the idea is to change the entire font of the dbgrid, not only for one column or row, this will serve me to see the data in size 10 or 12, 14 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 10, 2021 Share Posted July 10, 2021 5 hours ago, asapltda said: but the idea is to change the entire font of the dbgrid, not only for one column or row Yes I know. 10 hours ago, Sherzod said: One possible solution, you can use OnDrawColumnCell event for this. public { Public declarations } AGridFontSize: Integer; end; procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin Attribs.Font.Size := AGridFontSize; end; procedure TMainForm.UniButton1Click(Sender: TObject); begin AGridFontSize := 12; UniDBGrid1.Refresh; end; Quote Link to comment Share on other sites More sharing options...
asapltda Posted July 10, 2021 Author Share Posted July 10, 2021 Thank you very much Mr Sherzod 1 Quote Link to comment Share on other sites More sharing options...
FFREDIANELLI Posted April 19 Share Posted April 19 Hi, how to change the font family name to "Century Gothic" ? in the dbgrid, how to use the tunifontname ? in this example ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 20 Share Posted April 20 5 hours ago, FFREDIANELLI said: Hi, how to change the font family name to "Century Gothic" ? in the dbgrid, how to use the tunifontname ? in this example ? Hello, Well, about the same, using a variable as you wish: On 7/10/2021 at 8:28 AM, Sherzod said: procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin Attribs.Font.Size := AGridFontSize; end; procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin Attribs.Font.Name := 'Century Gothic'; end; 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.