Problem with changing font style
Hi, I've got DBCrossTab, and I check the value in order to change font style:
(in OnPrintCell event handler)
I get the error: Could not convert variant of type (Array Variant) into type (Integer).
When I do:
I get: Invalid variant operation.
But when I write:
I don't get any error, but of course the font isn't bolded.
When I write:
I don't get any error and font changes its color.
WTF with its style?
(in OnPrintCell event handler)
if value = 1 then Memo.Font.Style:=[fsBold];
I get the error: Could not convert variant of type (Array Variant) into type (Integer).
When I do:
if value = 1 then Memo.Font.Style:=Memo.Font.Style + [fsBold];
I get: Invalid variant operation.
But when I write:
if value = 1 then Memo.Font.Style:=fsBold;
I don't get any error, but of course the font isn't bolded.
When I write:
if value = 1 then Memo.Font.Color:=clBlue;
I don't get any error and font changes its color.
WTF with its style?
Comments
Damn, my version is: 4.7.138
So I think, I found a bug.
correct syntax no []
if value = 1 then Memo.Font.Style := fsBold;
Somewhat non-Delphi syntax, but it does work.
However, how do you remove the fsBold (ie: Font.Style := [] in Delphi) ?
I'm stuck with using
Memo.Font.Style := AnotherMemo.Font.Style;
which isn't very elegant.
if value = 1 then Memo.Font.Style := fsBold + fsItalic;
Memo.Font.Style := 0;
I am currently fixing the cement patio and check your problem. Works perfectly fine with me. dude.