TrackBar.Orientation Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating the horizontal or vertical orientation of the track bar.
public:
property System::Windows::Forms::Orientation Orientation { System::Windows::Forms::Orientation get(); void set(System::Windows::Forms::Orientation value); };
public System.Windows.Forms.Orientation Orientation { get; set; }
member this.Orientation : System.Windows.Forms.Orientation with get, set
Public Property Orientation As Orientation
Property Value
One of the Orientation values.
Exceptions
The assigned value is not one of the Orientation values.
Examples
The following example demonstrates how to set some of the TrackBar properties.
trackBar2->Orientation = Orientation::Vertical;
trackBar3->Orientation = Orientation::Vertical;
trackBar1->Maximum = 255;
trackBar2->Maximum = 255;
trackBar3->Maximum = 255;
trackBar1->Width = 400;
trackBar2->Height = trackBar1->Width;
trackBar3->Height = trackBar1->Width;
trackBar1->LargeChange = 16;
trackBar2->LargeChange = 16;
trackBar3->LargeChange = 16;
trackBar2.Orientation = Orientation.Vertical;
trackBar3.Orientation = Orientation.Vertical;
trackBar1.Maximum = trackBar2.Maximum = trackBar3.Maximum = 255;
trackBar1.Width = 400;
trackBar2.Height = trackBar3.Height = trackBar1.Width;
trackBar1.LargeChange = trackBar2.LargeChange = trackBar3.LargeChange = 16;
trackBar2.Orientation = Orientation.Vertical
trackBar3.Orientation = Orientation.Vertical
trackBar1.Maximum = 255
trackBar2.Maximum = 255
trackBar3.Maximum = 255
trackBar1.Width = 400
trackBar2.Height = 400
trackBar3.Height = 400
trackBar1.LargeChange = 16
trackBar2.LargeChange = 16
trackBar3.LargeChange = 16
Remarks
When the Orientation property is set to Orientation.Horizontal, the scroll box moves from left to right as the Value increases. When the Orientation property is set to Orientation.Vertical, the scroll box moves from bottom to top as the Value increases.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈