C++ > CLI:ステータスバー

「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&amp;act=open&amp;pageid=265&amp;file=status.png" /></strong></p> <p><strong><br /> ステータスバーの左端にプルダウンメニューがあるので<br /> クリックしてステータスラベルを作成します。</strong></p> <p><strong><img alt="" src="http://www21.atwiki.jp/opengl?cmd=upload&amp;act=open&amp;pageid=265&amp;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&amp;act=open&amp;pageid=265&amp;file=align.png" /></strong></p> <p><strong><br /> ビルドして実行してみましょう。</strong></p> <p><strong><img alt="" src="http://www21.atwiki.jp/opengl?cmd=upload&amp;act=open&amp;pageid=265&amp;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-&gt;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> /// &lt;summary&gt;<br />  /// MyForm の概要<br />  /// &lt;/summary&gt;<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 />   /// &lt;summary&gt;<br />   /// 使用中のリソースをすべてクリーンアップします。<br />   /// &lt;/summary&gt;<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 />   /// &lt;summary&gt;<br />   /// 必要なデザイナー変数です。<br />   /// &lt;/summary&gt;<br />   System::ComponentModel::Container ^components;</p> <p>#pragma region Windows Form Designer generated code<br />   /// &lt;summary&gt;<br />   /// デザイナー サポートに必要なメソッドです。このメソッドの内容を<br />   /// コード エディターで変更しないでください。<br />   /// &lt;/summary&gt;<br />   void InitializeComponent(void)<br />   {<br />    this-&gt;statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());<br />    this-&gt;toolStripStatusLabel1 = (gcnew System::Windows::Forms::ToolStripStatusLabel());<br />    this-&gt;statusStrip1-&gt;SuspendLayout();<br />    this-&gt;SuspendLayout();<br />    //<br />    // statusStrip1<br />    //<br />    this-&gt;statusStrip1-&gt;Items-&gt;AddRange(gcnew cli::array&lt; System::Windows::Forms::ToolStripItem^  &gt;(1) {this-&gt;toolStripStatusLabel1});<br />    this-&gt;statusStrip1-&gt;Location = System::Drawing::Point(0, 239);<br />    this-&gt;statusStrip1-&gt;Name = L"statusStrip1";<br />    this-&gt;statusStrip1-&gt;Size = System::Drawing::Size(284, 22);<br />    this-&gt;statusStrip1-&gt;TabIndex = 0;<br />    this-&gt;statusStrip1-&gt;Text = L"statusStrip1";<br />    //<br />    // toolStripStatusLabel1<br />    //<br />    this-&gt;toolStripStatusLabel1-&gt;Name = L"toolStripStatusLabel1";<br />    this-&gt;toolStripStatusLabel1-&gt;Size = System::Drawing::Size(238, 17);<br />    this-&gt;toolStripStatusLabel1-&gt;Spring = true;<br />    this-&gt;toolStripStatusLabel1-&gt;Text = L"ステータスバー";<br />    this-&gt;toolStripStatusLabel1-&gt;TextAlign = System::Drawing::ContentAlignment::MiddleRight;<br />    //<br />    // MyForm<br />    //<br />    this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 12);<br />    this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;<br />    this-&gt;ClientSize = System::Drawing::Size(284, 261);<br />    this-&gt;Controls-&gt;Add(this-&gt;statusStrip1);<br />    this-&gt;Name = L"MyForm";<br />    this-&gt;Text = L"Hello C++/CLI World !!";<br />    this-&gt;statusStrip1-&gt;ResumeLayout(false);<br />    this-&gt;statusStrip1-&gt;PerformLayout();<br />    this-&gt;ResumeLayout(false);<br />    this-&gt;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>

表示オプション

横に並べて表示:
変化行の前後のみ表示: