home *** CD-ROM | disk | FTP | other *** search
- unit Main;
-
- { Program copyright (c) 1995 by Charles Calvert }
- { Project Name: LISTSUB }
-
- { Tired of always writing ListBox1.Items.Add? The ListBox shown
- in unit MYLIST lets you right ListBox1.Add. }
-
- interface
-
- uses
- WinTypes, WinProcs, Classes,
- Graphics, Forms, Controls,
- MyList, StdCtrls, SysUtils,
- DB, Dialogs;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- Database1: TDatabase;
- GetCurrent: TButton;
- procedure Button1Click(Sender: TObject);
- procedure GetCurrentClick(Sender: TObject);
- private
- LBox: TMyListBox;
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.Button1Click(Sender: TObject);
- var
- i: Integer;
- begin
- GetCurrent.Enabled := True;
- LBox := TMyListBox.Create(Self);
- LBox.Parent := Form1;
- LBox.Left := 10;
- LBox.Top := 10;
- Lbox.Width := ClientWidth - 20;
- LBox.Height := ClientHeight - 75;
- LBox.Visible := True;
- for i := 1 to 100 do
- LBox.Add('Itemless ListBox! => ' + IntToStr(i));
- end;
-
- procedure TForm1.GetCurrentClick(Sender: TObject);
- var
- S: string;
- begin
- S := LBox.CurString;
- MessageDlg(S, mtInformation, [mbOk], 0);
- end;
-
- end.
-
-