saber quantas linhas tem um label...
olá, tem como saber quantas linhas tem um label?
Balceiro
Curtidas 0
Respostas
Rômulo Barros
16/12/2004
Coloque um LABEL e um BOTÃO no seu formulário. Agora, no evento OnClick do botão, faça:
procedure TForm1.Button1Click(Sender: TObject); Var Linhas : Tstrings; begin Label1.Caption := ´Linha1 ´ + chr(10) + ´Linha2´ + chr(10) + ´Linha3´ + chr(10) + ´Linha4´ + chr(10) + ´Linha5´; Try Linhas := TStringList.Create; Linhas.Text := Label1.Caption; ShowMessage(´Meu Label Possui ´ + IntToStr(Linhas.Count) + ´ linhas´); Finally FreeAndNil(Linhas); End; end;
GOSTEI 0