Panels : Panel « GUI Form « Visual C++ .NET

Home
Visual C++ .NET
1.2D
2.Class
3.Collections
4.Data Type
5.Database ADO.net
6.Delegate
7.Development
8.File Directory
9.Function
10.Generics
11.GUI Form
12.Language Basics
13.Network
14.Reflection
15.Security
16.Statement
17.Structure
18.Thread
19.XML
Visual C++ .NET » GUI Form » Panel 




Panels
 

  using namespace System;
  using namespace System::ComponentModel;
  using namespace System::Collections;
  using namespace System::Windows::Forms;
  using namespace System::Data;
  using namespace System::Drawing;


  public ref class Form1 : public System::Windows::Forms::Form
  {
  public:
    Form1(void)
    {
      InitializeComponent();
    }

  private:
        System::Windows::Forms::Panel^  Rightpanel;
        System::Windows::Forms::Button^  button2;
        System::Windows::Forms::Button^  button1;
        System::Windows::Forms::Panel^  Leftpanel;
        System::Windows::Forms::Button^  bnHide;
        System::Windows::Forms::Button^  bnDisable;

    void InitializeComponent(void)
    {
            this->Rightpanel = (gcnew System::Windows::Forms::Panel());
            this->button2 = (gcnew System::Windows::Forms::Button());
            this->button1 = (gcnew System::Windows::Forms::Button());
            this->Leftpanel = (gcnew System::Windows::Forms::Panel());
            this->bnHide = (gcnew System::Windows::Forms::Button());
            this->bnDisable = (gcnew System::Windows::Forms::Button());
            this->Rightpanel->SuspendLayout();
            this->Leftpanel->SuspendLayout();
            this->SuspendLayout();
            // 
            // Rightpanel
            // 
            this->Rightpanel->AutoScroll = true;
            this->Rightpanel->BorderStyle = 
                System::Windows::Forms::BorderStyle::Fixed3D;
            this->Rightpanel->Controls->Add(this->button2);
            this->Rightpanel->Controls->Add(this->button1);
            this->Rightpanel->Location = System::Drawing::Point(16122);
            this->Rightpanel->Name = L"Rightpanel";
            this->Rightpanel->Size = System::Drawing::Size(12160);
            this->Rightpanel->TabIndex = 3;

            // 
            // button2
            // 
            this->button2->Location = System::Drawing::Point(2062);
            this->button2->Name = L"button2";
            this->button2->Size = System::Drawing::Size(7523);
            this->button2->TabIndex = 1;
            this->button2->Text = L"button 2";
            // 
            // button1
            // 
            this->button1->Location = System::Drawing::Point(207);
            this->button1->Name = L"button1";
            this->button1->Size = System::Drawing::Size(7523);
            this->button1->TabIndex = 0;
            this->button1->Text = L"button 1";
            // 
            // Leftpanel
            // 
            this->Leftpanel->BorderStyle = 
                System::Windows::Forms::BorderStyle::FixedSingle;
            this->Leftpanel->Controls->Add(this->bnHide);
            this->Leftpanel->Controls->Add(this->bnDisable);
            this->Leftpanel->Location = System::Drawing::Point(2822);
            this->Leftpanel->Name = L"Leftpanel";
            this->Leftpanel->Size = System::Drawing::Size(12095);
            this->Leftpanel->TabIndex = 2;
            // 
            // bnHide
            // 
            this->bnHide->Location = System::Drawing::Point(1762);
            this->bnHide->Name = L"bnHide";
            this->bnHide->Size = System::Drawing::Size(7523);
            this->bnHide->TabIndex = 1;
            this->bnHide->Text = L"Hide";
            this->bnHide->Click += 
                gcnew System::EventHandler(this, &Form1::bnHide_Click);
            // 
            // bnDisable
            // 
            this->bnDisable->Location = System::Drawing::Point(177);
            this->bnDisable->Name = L"bnDisable";
            this->bnDisable->Size = System::Drawing::Size(7523);
            this->bnDisable->TabIndex = 0;
            this->bnDisable->Text = L"Disable";
            this->bnDisable->Click += 
                gcnew System::EventHandler(this, &Form1::bnDisable_Click);
            // 
            // Form1
            // 
            this->AutoScaleDimensions = System::Drawing::SizeF(613);
            this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this->ClientSize = System::Drawing::Size(310139);
            this->Controls->Add(this->Rightpanel);
            this->Controls->Add(this->Leftpanel);
            this->Name = L"Form1";
            this->Text = L"A hidden fourth button";
            this->Rightpanel->ResumeLayout(false);
            this->Leftpanel->ResumeLayout(false);
            this->ResumeLayout(false);
    }
    private
        System::Void bnDisable_Click(System::Object^ sender, System::EventArgs^ e)
        {
            Rightpanel->Enabled = !Rightpanel->Enabled;
        }

    private
        System::Void bnHide_Click(System::Object^ sender, System::EventArgs^ e)
        {
            Rightpanel->Visible = !Rightpanel->Visible;
        }
  };


[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
  Application::Run(gcnew Form1());
  return 0;
}

   
  














Related examples in the same category
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.