C++ > CLI:スプリットコンテナ

基本プロジェクトにスプリットコンテナを配置します。


ビルドして実行してみましょう。
パネルとパネルの境界線を自由に移動させる事ができます。

MyForm.cpp

#pragma comment(linker, "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
#include "MyForm.h"

using namespace Project1;

[STAThreadAttribute]
int main(){
 MyForm ^form1 = gcnew MyForm;
 form1->ShowDialog();
 return 0;
}

MyForm.h

#pragma once

namespace Project1 {

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

 /// <summary>
 /// MyForm の概要
 /// </summary>
 public ref class MyForm : public System::Windows::Forms::Form
 {
 public:
  MyForm(void)
  {
   InitializeComponent();
   //
   //TODO: ここにコンストラクター コードを追加します
   //
  }

 protected:
  /// <summary>
  /// 使用中のリソースをすべてクリーンアップします。
  /// </summary>
  ~MyForm()
  {
   if (components)
   {
    delete components;
   }
  }
 private: System::Windows::Forms::SplitContainer^  splitContainer1;
 protected:


 protected:

 private:
  /// <summary>
  /// 必要なデザイナー変数です。
  /// </summary>
  System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
  /// <summary>
  /// デザイナー サポートに必要なメソッドです。このメソッドの内容を
  /// コード エディターで変更しないでください。
  /// </summary>
  void InitializeComponent(void)
  {
   this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
   (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->splitContainer1))->BeginInit();
   this->splitContainer1->SuspendLayout();
   this->SuspendLayout();
   //
   // splitContainer1
   //
   this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
   this->splitContainer1->Location = System::Drawing::Point(0, 0);
   this->splitContainer1->Name = L"splitContainer1";
   this->splitContainer1->Size = System::Drawing::Size(284, 261);
   this->splitContainer1->SplitterDistance = 94;
   this->splitContainer1->TabIndex = 0;
   //
   // MyForm
   //
   this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
   this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
   this->ClientSize = System::Drawing::Size(284, 261);
   this->Controls->Add(this->splitContainer1);
   this->Name = L"MyForm";
   this->Text = L"Hello C++/CLI World !!";
   (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->splitContainer1))->EndInit();
   this->splitContainer1->ResumeLayout(false);
   this->ResumeLayout(false);

  }
#pragma endregion

 };
}

 

 

 

 

 

 

最終更新:2013年09月23日 15:37
添付ファイル