home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / Runimage / Delphi50 / Demos / ToolsAPI / INTAServices / displayu.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  1.3 KB  |  56 lines

  1. unit DisplayU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ExtDlgs, ExtCtrls, Buttons;
  8.  
  9. type
  10.   TDisplayForm = class(TForm)
  11.     GroupBox1: TGroupBox;
  12.     Button1: TButton;
  13.     Image1: TImage;
  14.     OpenPictureDialog1: TOpenPictureDialog;
  15.     GroupBox2: TGroupBox;
  16.     ComboBox1: TComboBox;
  17.     BitBtn1: TBitBtn;
  18.     BitBtn2: TBitBtn;
  19.     procedure ComboBox1Change(Sender: TObject);
  20.     procedure DisplayFormShow(Sender: TObject);
  21.     procedure Button1Click(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27.  
  28. var
  29.   DisplayForm: TDisplayForm;
  30.  
  31. implementation
  32.  
  33. {$R *.DFM}
  34.  
  35. procedure TDisplayForm.ComboBox1Change(Sender: TObject);
  36. begin
  37.   ComboBox1.Text := ComboBox1.SelText;
  38. end;
  39.  
  40. procedure TDisplayForm.DisplayFormShow(Sender: TObject);
  41. begin
  42.   ComboBox1.Text := ComboBox1.items[1];
  43. end;
  44.  
  45. procedure TDisplayForm.Button1Click(Sender: TObject);
  46. begin
  47. //Make sure you load a "correct" toolbutton, you fail later when
  48. //you try to add it to the IDE's image list.
  49.  
  50. //The Open dialog is set to the shared borland images directory.
  51.   if OpenPictureDialog1.Execute then
  52.     Image1.Picture.LoadFromFile(OpenPictureDialog1.filename);
  53. end;
  54.  
  55. end.
  56.