TableLayoutPanel.ColumnStyles プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TableLayoutPanel.ColumnStyles プロパティの意味・解説 

TableLayoutPanel.ColumnStyles プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

TableLayoutPanel の列スタイルコレクション取得します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public ReadOnly Property
 ColumnStyles As TableLayoutColumnStyleCollection
Dim instance As TableLayoutPanel
Dim value As TableLayoutColumnStyleCollection

value = instance.ColumnStyles
public TableLayoutColumnStyleCollection ColumnStyles { get;
 }
public:
property TableLayoutColumnStyleCollection^ ColumnStyles {
    TableLayoutColumnStyleCollection^ get ();
}
/** @property */
public TableLayoutColumnStyleCollection get_ColumnStyles ()
public function get ColumnStyles
 () : TableLayoutColumnStyleCollection

プロパティ
TableLayoutPanel コントロール内の各列の ColumnStyle を格納している TableLayoutColumnStyleCollection。

解説解説
使用例使用例

Buttonクリックされたときに各列の ColumnStyle プロパティ設定するコード例次に示します

Private Sub toggleColumnStylesBtn_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles toggleColumnStylesBtn.Click

    Dim styles As TableLayoutColumnStyleCollection
 = _
    Me.TableLayoutPanel1.ColumnStyles

    For Each style As ColumnStyle
 In styles

        If style.SizeType = SizeType.Absolute Then

            style.SizeType = SizeType.AutoSize

        ElseIf style.SizeType = SizeType.AutoSize Then

            style.SizeType = SizeType.Percent

            ' Set the column width to be a percentage
            ' of the TableLayoutPanel control's width.
            style.Width = 33

        Else

            ' Set the column width to 50 pixels.
            style.SizeType = SizeType.Absolute
            style.Width = 50

        End If

    Next

End Sub
private void toggleColumnStylesBtn_Click(
    System.Object sender, 
    System.EventArgs e)
{
    TableLayoutColumnStyleCollection styles = 
        this.TableLayoutPanel1.ColumnStyles;

    foreach( ColumnStyle style in styles )
    {
        if( style.SizeType == SizeType.Absolute )
        {
            style.SizeType = SizeType.AutoSize;
        }
        else if( style.SizeType == SizeType.AutoSize
 )
        {
            style.SizeType = SizeType.Percent;

            // Set the column width to be a percentage
            // of the TableLayoutPanel control's width.
            style.Width = 33;
        }
        else
        {
            // Set the column width to 50 pixels.
            style.SizeType = SizeType.Absolute;
            style.Width = 50;
        }
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TableLayoutPanel クラス
TableLayoutPanel メンバ
System.Windows.Forms 名前空間
ColumnStyle クラス
RowStyles
その他の技術情報
TableLayoutPanel コントロールにおける AutoSize 動作



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「TableLayoutPanel.ColumnStyles プロパティ」の関連用語

TableLayoutPanel.ColumnStyles プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TableLayoutPanel.ColumnStyles プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS