With Sizer, you can easily add controls to the form to create a form layout. Each added control can be positioned over a single grid cell or it may span over multiple cells.
Let us discuss how to add controls to the Sizer control at design time and through code.
You can add controls to Sizer at design time without writing a single line of code. For more information on how to add controls at design time, see Create Layout at design time section in the Quick Start topic.
You can add controls to the Sizer and position them within the grid layout through code as well.
Follow the given steps to add controls to Sizer.
C# |
コードのコピー
|
---|---|
Type your example code here. It will be automatically colorized when you switch to Preview or build the help system.
|
C# |
コードのコピー
|
---|---|
Type your example code here. It will be automatically colorized when you switch to Preview or build the help system.
|
C# |
コードのコピー
|
---|---|
Type your example code here. It will be automatically colorized when you switch to Preview or build the help system.
|
C# |
コードのコピー
|
---|---|
Type your example code here. It will be automatically colorized when you switch to Preview or build the help system.
|
This adds the control to the desired location within the grid. You can observe that the Sizer snaps the controls to the specified position on the grid, and automatically resizes the control when the form is resized.