 
			
				04.05.2018, 13:04
			
			
			
		  
	 | 
	
		
		
		
			  | 
			
			
				
				
				 I Like it! 
				
				
			 | 
			  | 
			
				
				
					Регистрация: 12.12.2009 
					Адрес: Россия, г. Новосибирск 
					
					Сообщения: 663
 
				Версия Delphi: D6/D7 
					Репутация: 26643 
					    
				 
				
			 | 
		 
		 
		
	 | 
	
	
	
		
			
			
			 
			
		
		
		
		
	Код: 
	procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  ComboBox1.Items.Clear;
  ComboBox1.Items.Add('Show all');
  ComboBox1.Items.Add('Hide all');
  for i := Low(Buttons) to High(Buttons) do
  begin
    Buttons[i] := TButton.Create(Self);
    with Buttons[i] do
    begin
      Parent := Self;
      SetBounds(10 + (i - Low(Buttons)) * 80, 50, 70, 25);
      Caption := 'Buttons[' + IntToStr(i) + ']';
      ComboBox1.Items.AddObject(Caption, Pointer(i));
      Show;
    end;
  end;
  ComboBox1.ItemIndex := 0;
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
var
  i: Integer;
begin
  for i := Low(Buttons) to High(Buttons) do
    if ComboBox1.ItemIndex in [0, 1] then
      Buttons[i].Visible := ComboBox1.ItemIndex = 0
    else
      Buttons[i].Visible := Integer(ComboBox1.Items.Objects[ComboBox1.ItemIndex]) = i;
end; 
  
		
	
		
		
		
		
			
		
		
		
		
	
		
		
	
	
	 |