Topic: Change Grid Font
Hello Dmitry
I would like allow to end user to modify if he wants police for the grid.
In addition, the user will pass through a FontDialog
I use for it this code
function LoadFont: TFont;
var reg: TRegistry;
begin
result := TFont.Create;
reg := TRegistry.Create;
reg.Access := KEY_ALL_ACCESS;
reg.RootKey := HKEY_CURRENT_USER;
if reg.OpenKey('software\Diabet', true) then
begin
if reg.ValueExists('Font.Name') then result.Name := Reg.ReadString('Font.Name');
if reg.ValueExists('Font.Size') then result.Size := Reg.ReadInteger('Font.Size');
if reg.ValueExists('Font.Style.fsBold') then
if Reg.ReadBool('Font.Style.fsBold') then result.Style := result.Style + fsBold;
if reg.ValueExists('Font.Style.fsItalic') then
if Reg.ReadBool('Font.Style.fsItalic') then result.Style := result.Style + fsItalic;
if reg.ValueExists('Font.Style.fsUnderline') then
if Reg.ReadBool('Font.Style.fsUnderline') then result.Style := result.Style + fsUnderline;
if reg.ValueExists('Font.Style.fsStrikeOut') then
if Reg.ReadBool('Font.Style.fsStrikeOut') then result.Style := result.Style + fsStrikeOut;
reg.CloseKey;
end;
reg.Free;
end;
procedure SaveFont(Font: TFont);
var reg: TRegistry;
begin
reg := TRegistry.Create;
reg.Access := KEY_ALL_ACCESS;
reg.RootKey := HKEY_CURRENT_USER;
if reg.OpenKey('software\Diabet', true) then
begin
Reg.WriteString('Font.Name', Font.Name);
Reg.WriteInteger('Font.Size', Font.Size);
Reg.WriteBool('Font.Style.fsBold', fsBold in [Font.Style]);
Reg.WriteBool('Font.Style.fsItalic', fsItalic in [Font.Style]);
Reg.WriteBool('Font.Style.fsUnderline', fsUnderline in [Font.Style]);
Reg.WriteBool('Font.Style.fsStrikeOut', fsStrikeOut in [Font.Style]);
reg.CloseKey;
end;
reg.Free;
end;
The only one modification applies upon column header, but no impact about font for all text into the grid.
Does this MVD version (2.8 beta) allows this modification or is it yet impossible ?
Thanks Dmitry for your answer
JB