RowStyle クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
解説
RowStyle クラスは、TableLayoutPanel での行のユーザー インターフェイス (UI) 特性を表します。TableLayoutPanel のすべての行のスタイルは、TableLayoutPanel.RowStyles プロパティで収集されます。
TableLayoutRowStyleCollection から RowStyle を抽出する方法を次のコード例に示します。
このコード例は、TableLayoutPanel クラスのトピックで取り上げているコード例の一部分です。
Private Sub toggleRowStylesBtn_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles toggleRowStylesBtn.Click Dim styles As TableLayoutRowStyleCollection = _ Me.TableLayoutPanel1.RowStyles For Each style As RowStyle In styles If style.SizeType = SizeType.Absolute Then style.SizeType = SizeType.AutoSize ElseIf style.SizeType = SizeType.AutoSize Then style.SizeType = SizeType.Percent ' Set the row height to be a percentage ' of the TableLayoutPanel control's height. style.Height = 33 Else ' Set the row height to 50 pixels. style.SizeType = SizeType.Absolute style.Height = 50 End If Next End Sub
private void toggleRowStylesBtn_Click( System.Object sender, System.EventArgs e) { TableLayoutRowStyleCollection styles = this.TableLayoutPanel1.RowStyles; foreach( RowStyle style in styles ) { if (style.SizeType==SizeType.Absolute) { style.SizeType = SizeType.AutoSize; } else if(style.SizeType==SizeType.AutoSize) { style.SizeType = SizeType.Percent; // Set the row height to be a percentage // of the TableLayoutPanel control's height. style.Height = 33; } else { // Set the row height to 50 pixels. style.SizeType = SizeType.Absolute; style.Height = 50; } } }
System.Windows.Forms.TableLayoutStyle
System.Windows.Forms.RowStyle
プラットフォーム
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
RowStyle メンバ
System.Windows.Forms 名前空間
TableLayoutPanel.RowStyles
TableLayoutRowStyleCollection
ColumnStyle クラス
- RowStyle クラスのページへのリンク