内容へ移動
C++プログラマのためのC++/CLI入門
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
TOP
»
実用編
»
toolstrip上のアイテムを引き延ばす
実用編:toolstrip上のアイテムを引き延ばす
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== ToolStrip上のアイテムを引き延ばす ====== ブラウザのアドレスバーの様に1つのアイテムをその幅いっぱいまで引き伸ばすコードです。あんまり深く検証してませんので、実際使うときはよく確かめてから使ってください。 <code cpp> void stretchToolItem(ToolStrip^ bar, ToolStripItem^ itemstretch) { int all = bar->Size.Width; int other = 0; other += bar->Margin.Left; other += bar->Margin.Right; other += bar->GripRectangle.Width; other += bar->GripMargin.Left + bar->GripMargin.Right; for each( ToolStripItem^ item in bar->Items ) { if ( item != itemstretch ) { other += item->Size.Width; other += (item->Margin.Left + item->Margin.Right); other += (item->Padding.Left + item->Padding.Right); } } itemstretch->Size = ::Size(all - other, itemstretch->Size.Height); itemstretch->Visible = false; itemstretch->Visible = true; } </code> barがToolStripでitemstretchが引き延ばすアイテムです。最後にVisibleを設定し直してますが、なぜか引き延ばしたアイテムが表示されなくなるときがあるので付けています。
/var/www/html/virtual/cppcli/data/pages/実用編/toolstrip上のアイテムを引き延ばす.txt
· 最終更新: 2013/12/23 09:08 (外部編集)
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ