Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ListBox1: TListBox;
private
public
function SelText (ListBox1 : TListBox) : String;
end;
var
Form1: TForm1;
a: String;
SelItems :String;
nItem :Integer;
implementation
{$R *.dfm}
function TForm1.SelText (ListBox1 : TListBox) : String;
var
nItem : Integer;
begin
nItem := ListBox1.ItemIndex;
if nItem >= 0 then
Result := ListBox1.Items [nItem]
else
Result := '';
end;
begin
a:= TForm1.SelText(ListBox1);
end.
Pero sigo con el mismo error, siento ser tan pesado(y gracias por la rapidez de respuesta...
quiero asignar a la variable string a , el texto del valor seleccionado en el listbox y mostrarlo luego dentro del formulario...