Ir al contenido


Foto

Ancho de Columna en StringGrid


  • Por favor identifícate para responder
7 respuestas en este tema

#1 egostar

egostar

    missing my father, I love my mother.

  • Administrador
  • 14.446 mensajes
  • LocationMéxico

Escrito 07 abril 2009 - 04:34

Hola

Necesito dimensionar un StringGrid de acuerdo al tamaño de la forma de manera que las columnas tengan el mismo ancho al redimensionar la forma.

Intenté hacer esto sin obtener el resultado esperado.



delphi
  1.   StringGrid1.DefaultColWidth := Form1.Width div NumColumnas;



Alguien sabe como hacerlo?

Salud OS
  • 0

#2 egostar

egostar

    missing my father, I love my mother.

  • Administrador
  • 14.446 mensajes
  • LocationMéxico

Escrito 07 abril 2009 - 04:38

Hola

Me respondo a mi mismo :D

Utilice el evento OnResize de la forma y listo :D



delphi
  1. procedure TForm1.FormResize(Sender: TObject);
  2. begin
  3.   StringGrid1.DefaultColWidth := Form1.Width div NumColumnas;
  4. end;



Salud OS

  • 0

#3 Fenareth

Fenareth

    Advanced Member

  • Administrador
  • 3.486 mensajes
  • LocationMexico City

Escrito 07 abril 2009 - 04:45

Pues agradécete a ti mismo amiguito, no seas maleducado contigo  :p  :D

Saludos !
  • 0

#4 egostar

egostar

    missing my father, I love my mother.

  • Administrador
  • 14.446 mensajes
  • LocationMéxico

Escrito 07 abril 2009 - 04:54

Pues agradécete a ti mismo amiguito, no seas maleducado contigo  :p  :D

Saludos !


Opps, cierto. Muchas gracias ALTER EGO

Salud OS :p
  • 0

#5 eduarcol

eduarcol

    Advanced Member

  • Administrador
  • 4.483 mensajes
  • LocationVenezuela

Escrito 07 abril 2009 - 05:16



delphi
  1. StringGrid1.DefaultColWidth := (Form1.Width - 10) div NumColumnas;



asi le das cabida al scroll vertical
  • 0

#6 egostar

egostar

    missing my father, I love my mother.

  • Administrador
  • 14.446 mensajes
  • LocationMéxico

Escrito 07 abril 2009 - 05:24



delphi
  1. StringGrid1.DefaultColWidth := (Form1.Width - 10) div NumColumnas;



asi le das cabida al scroll vertical


Efectivamente amigo, ya habia pensado en eso, pero lo hice de esta forma



delphi
  1. procedure TForm1.FormResize(Sender: TObject);
  2. begin
  3.   StringGrid1.DefaultColWidth := (Form1.Width div NumColumnas) - 5;
  4. end;



(y)

Salud OS
  • 0

#7 root

root

    mister

  • Miembro Platino
  • PipPipPip
  • 529 mensajes
  • LocationMexico D.F:

Escrito 06 mayo 2009 - 05:18

funciona igual para el dbgrid ???


  • 0

#8 eduarcol

eduarcol

    Advanced Member

  • Administrador
  • 4.483 mensajes
  • LocationVenezuela

Escrito 06 mayo 2009 - 07:06

sip, tal cual...  :D
  • 0




IP.Board spam blocked by CleanTalk.