TrackBar.Orientation 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,该值指示跟踪条在水平方向还是在垂直方向。
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
属性值
Orientation 值之一。
例外
分配的值不是 Orientation 值之一。
示例
以下示例演示如何设置某些 TrackBar 属性。
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
注解
当属性 Orientation 设置为 Orientation.Horizontal时,滚动框从左向右移动, Value 因为增加。 当属性 Orientation 设置为 Orientation.Vertical时,滚动框从下到上移动, Value 因为增加。