Fórum Como alterar fonte num listview dependendo de uma condição? #323771
19/06/2006
0
Dei uma pesquisada aqui no fórum mais não achei.
To usando um listview no lugar do DBGrid e gostaria de alterar a fonte de um registro para negrito, só que dependendo de uma condição.
Num DBGrid eu faria assim Ex: if DmGeral.QRClienteNOME.Value =´Fulano´ then
DBGrid1.Canvas.Fonte.Style := [fsBold];
Mais não to conseguindo fazer isso usando o listview.
Se alguém puder me ajudar, ficarei grato.
Desde já agradeço.
Vitoreduardo
Curtir tópico
+ 0Posts
20/06/2006
Rodc
ListView1.Font.Style := [fsBold];
Isto não resolve o problema?
Gostei + 0
20/06/2006
Vitoreduardo
Não funcionou.
Fiz assim:
If DM_Geral.IBDSContas.FieldByName(´Situacao´).Value = ´Pago´then begin ListView1.Font.Style := [fsBold]; end;
Gostei + 0
20/06/2006
Rodc
if (Item.Caption = ´teste´) begin Sender.Canvas.Font->Style := [fsBold]; Sender.Canvas.TextOut(0, 0, ´´); end;
Abraços,
Gostei + 0
20/06/2006
Rodc
Gostei + 0
20/06/2006
Vitoreduardo
Fiz do jeito que vc falo.
if (Item.Caption = ´teste´) begin Sender.Canvas.Font->Style := [fsBold]; Sender.Canvas.TextOut(0, 0, ´´); end;
Mais não deu muito certo não, só se o ultimo registro tiver com a situação igual a pago, só que ai todos os registro fica em negrito.
Mais vou continuar tentando.
Obrigado.
Gostei + 0
21/06/2006
Rodc
if (Item.Caption = ´teste´) begin Sender.Canvas.Font.Style := [fsBold]; Sender.Canvas.TextOut(0, 0, ´´); end else begin Sender.Canvas.Font.Style := []; Sender.Canvas.TextOut(0, 0, ´´); end;
Gostei + 0
21/06/2006
Vitoreduardo
if (Item.Caption = ´teste´) begin Sender.Canvas.Font.Style := [fsBold]; Sender.Canvas.TextOut(0, 0, ´´); end else begin Sender.Canvas.Font.Style := []; Sender.Canvas.TextOut(0, 0, ´´); end;
Mais mesmo assim todos os registros ficam em negrito.
Gostei + 0
21/06/2006
Rodc
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)