Alinhamento Horizontal e Vertical StringGrid
02/02/2006
0
Fiz assim para alinhar:
Agora como faço para remover o texto do fundo para depois eu colocar o que eu fiz para alinhar??
Tentei usar o [b:ee4ac71feb]FillRect(Rect);[/b:ee4ac71feb]
Só que não aparece mais aquela cor que quando selecionamos a Cell ele aparece no fundo.
var o,w,h,x,y: Integer; Cel: String; begin Cel:= Grid.Cells[ACol,ARow]; if Not(Cel = ´´) then begin Rect.Top:= Rect.Top - 1; Rect.Left:= Rect.Left - 1; w:= Grid.Canvas.TextWidth(Cel); h:= Grid.Canvas.TextHeight(Cel); x:= ((Grid.ColWidths[ACol] - w) div 2) + Rect.Left; y:= ((Grid.RowHeights[ARow] - h) div 2) + Rect.Top; o:= SetBkMode(Grid.Canvas.Handle,TRANSPARENT); SetBkMode(Handle,o); Grid.Canvas.TextOut(x,y,Cel); SetBkMode(Handle,o); end
Agora como faço para remover o texto do fundo para depois eu colocar o que eu fiz para alinhar??
Tentei usar o [b:ee4ac71feb]FillRect(Rect);[/b:ee4ac71feb]
Só que não aparece mais aquela cor que quando selecionamos a Cell ele aparece no fundo.
Rudá
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)