filas selecionadas en stringgrid

Moderador: yalmar

Foro sobre popular lenguaje de Borland y el lenguaje pascal.

filas selecionadas en stringgrid

Notapor cojones » Mié Feb 14, 2007 1:22 pm

Necesito saber cuales filas de un Stringgrid estan selecionadas.
La idea es poder eliminar las filas selecionadas por el usuario.
Por mas q e buscado no e encontrado ningun metodo q me permita averiguar cuales estan selecionadas. algien me puede ayudar?.
gracias
cojones
Novato
Novato
 
Mensajes: 1
Registrado: Mié Feb 14, 2007 1:20 pm


Re: filas selecionadas en stringgrid

Notapor yalmar » Dom Feb 18, 2007 1:26 pm

Hola,

aqui una forma de hacerlo


Código: Seleccionar todo
  1.  

  2.      //get the coordinates of the selected region of the grid

  3.       LeftCell := StringGrid1.Selection.Left;

  4.       TopCell := StringGrid1.Selection.Top;

  5.       BottomCell := StringGrid1.Selection.Bottom;

  6.       RightCell := StringGrid1.Selection.Right;

  7.       //The variable TextBuf is used to hold the information that will to to the clipboard

  8.       TextBuf := '';

  9.       //for all of the selected cells, copy the contents to

  10.       //TextBuf and separate lines by returns and cells by tabs

  11.       for i := TopCell to BottomCell do begin

  12.          for j := LeftCell to RightCell do begin

  13.            // here insert the code to remove the selected rows from the stringgrid

  14.          end;

  15.       end;



salu2
Avatar de Usuario
yalmar
Colaborador
Colaborador
 
Mensajes: 264
Registrado: Mié Jun 09, 2004 4:14 pm
Ubicación: Brasil



    

Volver a Pascal

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados