FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
||||
|
||||
Centrar celdas en un TSTringGrid
Sé que es una pregunta muy tonta, pero no la resuelvo por incompatibilidad entre los tipos Integer y Double.
Qué me falta para poder centrar el texto dentro de una celda de un TStringGrid ? Si pongo me dá error. Gracias |
#2
|
|||
|
|||
El componente JvStringGrid de la JVCL (www.delphi-jedi.org) te permite hacer esto sin codigo..
|
#3
|
||||
|
||||
De entrada tienes que usar divisiones enteras (div), luegos debes pensar que el TRect del grid contienes posiones respecto al origen del mismo
nota: como no tengo el delphi a mano, no recuerdo si el valor que se pasa en segundo lugar es la posición de inicio dentro de la celda o el tamaño del texto a dibujar, pero por ahi van los tiros Saludos, salvica |
#4
|
||||
|
||||
Gracias, me ha servido mucho tu explicación.
Finalmente ha quedado así : Debo indicar adicionalmente que el ancho de la celda es fijo por diseño y es = 16. Por ello 16/2 = 8 y es el valor que he puesto en Rect.Left+8-LonTxt Saludos |
|
|
|