Ver Mensaje Individual
  #6  
Antiguo 11-04-2011
coej coej is offline
Miembro
NULL
 
Registrado: abr 2011
Ubicación: MANCHEGO-ESPAÑOL
Posts: 65
Reputación: 16
coej Va por buen camino
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
  ListBox1: TListBox;


  private
    { Private declarations }
  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...

Última edición por ecfisa fecha: 11-04-2011 a las 17:05:46. Razón: ETIQUETAS [DELPHI], [/DELPHI] ...
Responder Con Cita