Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 6th, 2018 62 in 2 days
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     Button1: TButton;
  16.     Memo1: TMemo;
  17.     Panel1: TPanel;
  18.     Panel2: TPanel;
  19.     procedure Button1Click(Sender: TObject);
  20.     procedure FormCreate(Sender: TObject);
  21.   private
  22.   public
  23.     procedure NotifyVisible(Sender: TObject);
  24.   end;
  25.  
  26. var
  27.   Form1: TForm1;
  28.  
  29. implementation
  30.  
  31. {$R *.lfm}
  32.  
  33. { TForm1 }
  34.  
  35. procedure TForm1.FormCreate(Sender: TObject);
  36. begin
  37.   Panel2.AddHandlerOnVisibleChanged(@NotifyVisible)
  38. end;
  39.  
  40. procedure TForm1.NotifyVisible(Sender: TObject);
  41. begin
  42.   Memo1.Lines.Add('Control is '+BoolToStr((Sender as TControl).Visible));
  43. end;
  44.  
  45. procedure TForm1.Button1Click(Sender: TObject);
  46. begin
  47.   Panel2.Visible := not Panel2.Visible;
  48. end;
  49.  
  50. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top