Fórum como descubro qual a linha do listview foi selecionada? #348400
04/11/2007
0
Como eu descubro qual a linha do listview foi selecionada? Tentei usar o itemindex, mas dá erro?
Rsa_tche
Curtir tópico
+ 0Posts
05/11/2007
Edilcimar
ValueListEditor.MouseToCell(X,Y,ACol,ARow);
ValorDesejado1 := ValueListEditor.Cells[0,Arow];
ValorDesejadoN := ValueListEditor.Cells[N-1,Arow]);
Gostei + 0
05/11/2007
Massuda
Gostei + 0
05/11/2007
Rsa_tche
dá erro na linha do ValueListEditor.MouseToCell(X,Y,ACol,ARow);
Gostei + 0
05/11/2007
Rsa_tche
Fiz assim:
if ListView1.Selected <> nil then
begin
ListItem := ListView1.Selected;
Edt_descricao.Text:= ListItem.Caption;
Edt_preco.Text:= ListItem.Subitems[0];
Edt_imagem.Text:= ListItem.Subitems[1];
end;
Gostei + 0
05/11/2007
Edilcimar
procedure TForm94.ValueListEditor2MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
ACol, ARow : Integer;
begin
ValueListEditor2.MouseToCell(X,Y,ACol,ARow);
If (ARow >= 0) and (ARow < ValueListEditor2.RowCount) then
Begin
Cfop := ValueListEditor2.Cells[0,Arow];
Icms := StrToFloat(ValueListEditor2.Cells[1,Arow]);
End
Else
ValueListEditor2.ShowHint := False;
end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)