Cita:
Empezado por blacktoroII
O como se puede seleccionar la linea completa en un richedit con el teclado...
|
Para seleccionar la línea completa lo puedes hacer de esta forma:
Código Delphi
[-]
procedure TForm1.RichEdit1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
Indice, LineaActual : Integer;
begin
if (Key=vk_Up) or (Key=vk_down) then
begin
LineaActual := RichEdit1.Perform(EM_LINEFROMCHAR, RichEdit1.SelStart, 0);
Indice := RichEdit1.Perform(EM_LINEINDEX, LineaActual, 0);
RichEdit1.SelStart:= Indice;
RichEdit1.SelLength := Length(RichEdit1.Lines[lineaActual]);
end;
end;
Saluditos