「C++/CLI:ステータスバー」の編集履歴(バックアップ)一覧はこちら
「C++/CLI:ステータスバー」(2013/09/24 (火) 20:13:38) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
<p><strong>基本プロジェクトにステータスバーを配置します。<br />
ステータスバーの左端にプルダウンメニューがあるので<br />
クリックしてステータスラベルを作成します。<br />
プロパティの Spring を「True」にして、Text を<br />
「ステータスバー」にします。<br />
TextAlign を「MiddleRight」にします。<br />
ビルドして実行してみましょう。</strong></p>
<p><strong>基本プロジェクトにステータスバーを配置します。</strong></p>
<p><strong><img alt="" src="http://www21.atwiki.jp/opengl?cmd=upload&act=open&pageid=265&file=status.png" /></strong></p>
<p><strong><br />
ステータスバーの左端にプルダウンメニューがあるので<br />
クリックしてステータスラベルを作成します。</strong></p>
<p><strong><img alt="" src="http://www21.atwiki.jp/opengl?cmd=upload&act=open&pageid=265&file=label.png" /></strong></p>
<p><strong><br />
プロパティの Spring を「True」にして、Text を<br />
「ステータスバー」にします。<br />
TextAlign を「MiddleRight」にします。</strong></p>
<p><strong><img alt="" src="http://www21.atwiki.jp/opengl?cmd=upload&act=open&pageid=265&file=align.png" /></strong></p>
<p><strong><br />
ビルドして実行してみましょう。</strong></p>
<p><strong><img alt="" src="http://www21.atwiki.jp/opengl?cmd=upload&act=open&pageid=265&file=st.png" /></strong></p>
<p>MyForm.cpp</p>
<table cellspacing="1" cellpadding="1" width="600" border="1"><tbody><tr><td>
<p>#pragma comment(linker, "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")<br />
#include "MyForm.h"</p>
<p>using namespace Project1;</p>
<p>[STAThreadAttribute]<br />
int main(){<br />
MyForm ^form1 = gcnew MyForm;<br />
form1->ShowDialog();<br />
return 0;<br />
}</p>
</td>
</tr></tbody></table><p>MyForm.h</p>
<table cellspacing="1" cellpadding="1" width="600" border="1"><tbody><tr><td>
<p>#pragma once</p>
<p>namespace Project1 {</p>
<p> using namespace System;<br />
using namespace System::ComponentModel;<br />
using namespace System::Collections;<br />
using namespace System::Windows::Forms;<br />
using namespace System::Data;<br />
using namespace System::Drawing;</p>
<p> /// <summary><br />
/// MyForm の概要<br />
/// </summary><br />
public ref class MyForm : public System::Windows::Forms::Form<br />
{<br />
public:<br />
MyForm(void)<br />
{<br />
InitializeComponent();<br />
//<br />
//TODO: ここにコンストラクター コードを追加します<br />
//<br />
}</p>
<p> protected:<br />
/// <summary><br />
/// 使用中のリソースをすべてクリーンアップします。<br />
/// </summary><br />
~MyForm()<br />
{<br />
if (components)<br />
{<br />
delete components;<br />
}<br />
}<br />
private: System::Windows::Forms::StatusStrip^ statusStrip1;<br />
private: System::Windows::Forms::ToolStripStatusLabel^
toolStripStatusLabel1;</p>
<p> protected:</p>
<p> </p>
<p> protected:</p>
<p> private:<br />
/// <summary><br />
/// 必要なデザイナー変数です。<br />
/// </summary><br />
System::ComponentModel::Container ^components;</p>
<p>#pragma region Windows Form Designer generated code<br />
/// <summary><br />
/// デザイナー サポートに必要なメソッドです。このメソッドの内容を<br />
/// コード エディターで変更しないでください。<br />
/// </summary><br />
void InitializeComponent(void)<br />
{<br />
this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());<br />
this->toolStripStatusLabel1 = (gcnew
System::Windows::Forms::ToolStripStatusLabel());<br />
this->statusStrip1->SuspendLayout();<br />
this->SuspendLayout();<br />
//<br />
// statusStrip1<br />
//<br />
this->statusStrip1->Items->AddRange(gcnew cli::array<
System::Windows::Forms::ToolStripItem^ >(1)
{this->toolStripStatusLabel1});<br />
this->statusStrip1->Location = System::Drawing::Point(0, 239);<br />
this->statusStrip1->Name = L"statusStrip1";<br />
this->statusStrip1->Size = System::Drawing::Size(284, 22);<br />
this->statusStrip1->TabIndex = 0;<br />
this->statusStrip1->Text = L"statusStrip1";<br />
//<br />
// toolStripStatusLabel1<br />
//<br />
this->toolStripStatusLabel1->Name = L"toolStripStatusLabel1";<br />
this->toolStripStatusLabel1->Size = System::Drawing::Size(238,
17);<br />
this->toolStripStatusLabel1->Spring = true;<br />
this->toolStripStatusLabel1->Text = L"ステータスバー";<br />
this->toolStripStatusLabel1->TextAlign =
System::Drawing::ContentAlignment::MiddleRight;<br />
//<br />
// MyForm<br />
//<br />
this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);<br />
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;<br />
this->ClientSize = System::Drawing::Size(284, 261);<br />
this->Controls->Add(this->statusStrip1);<br />
this->Name = L"MyForm";<br />
this->Text = L"Hello C++/CLI World !!";<br />
this->statusStrip1->ResumeLayout(false);<br />
this->statusStrip1->PerformLayout();<br />
this->ResumeLayout(false);<br />
this->PerformLayout();</p>
<p> }<br />
#pragma endregion</p>
<p> };<br />
}</p>
</td>
</tr></tbody></table><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>