Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the VB.NET Dock property

Shulou Source: shulou.com Published: 2022-06-02 08:58:28 10月24日 Update

Editor to share with you how to use the VB.NET Dock attribute, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The Anchor property can be set to any combination of Top,Bottom,Left and Right. The default setting is Top,Left. This keeps the top-left corner of the control in the same relative position as the window frame. Set the Anchor property to Top and Bottom to adjust the control vertically to ensure the same distance from the bottom of the window to the bottom of the control.

Me.TextBox1.Anchor = (System.Windows.Forms.AnchorStyles.

Top Or System.Windows.Forms.AnchorStyles.Left)

VB.NET Dock attribute

This property can be set to Top,Bottom,Left,Right or Fill. Set it to Top,Bottom,Left or Right to make the control close to the specified edge of the window, or to other controls that have been placed on the edge of the corresponding window. Set the VB.NET Dock property to Fill to adjust the control to fill the entire client area of the window.

Me.Panel1.Dock = System.Windows.Forms.DockStyle.Bottom

You can also use the DockPadding object to set the area between the fill window border and the placed control. It has properties for each window border, which can also be achieved by setting the All property if you want the border to be consistent with each edge.

Me.DockPadding.All = 5

The new control tuning feature in Visual Basic.NET eliminates many of the necessary tuning programs in previous versions of Visual Basic. Most adjustment tasks can be handled by setting new VB.NET Dock and Anchor properties in the window designer without programming at all.

The above is all the content of this article "how to use VB.NET Dock attributes". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Properties controls windows adjustments borders articles same content can be passed bottom edge consistent not so task location function area most customer Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Microsoft Shulou Tech Info Redmi MariaDB