Share via


ITransformProvider.Rotate(Double) 方法

定義

旋轉控制項。

public:
 void Rotate(double degrees);
public void Rotate (double degrees);
abstract member Rotate : double -> unit
Public Sub Rotate (degrees As Double)

參數

degrees
Double

控制項的旋轉度數。 正數會順時針旋轉,負數會逆時針旋轉。

例外狀況

如果 CanRotate 屬性為 false。

範例

下列範例針對無法旋轉的自訂控制項,顯示這個方法的其中一個可能實作。

/// <summary>
/// Rotates the provider the specified number of degrees.
/// </summary>
void ITransformProvider.Rotate(double degreesToRotate)
{
    throw new InvalidOperationException("Operation cannot be performed.");
}
''' <summary>
''' Rotates the provider the specified number of degrees.
''' </summary>
Private Sub Rotate(ByVal degreesToRotate As Double) Implements ITransformProvider.Rotate
    Throw New InvalidOperationException("Operation cannot be performed.")
End Sub

備註

物件無法移動、調整大小或旋轉,使其產生的螢幕位置完全超出其容器的座標,而且無法存取鍵盤或滑鼠。 例如,當最上層視窗完全從畫面外移動,或子物件移出容器檢視區的界限時。 在這些情況下,物件會盡可能接近要求的螢幕座標,並覆寫上方或左座標以在容器界限內。

適用於

另請參閱