Control.UpdateStyles メソッド
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
割り当て済みのスタイルを強制的にコントロールに再適用します。
protected:
void UpdateStyles();
C#
protected void UpdateStyles ();
member this.UpdateStyles : unit -> unit
Protected Sub UpdateStyles ()
次のコード例では、a のダブル バッファリングを有効に Form し、変更を反映するようにスタイルを更新します。
public:
void EnableDoubleBuffering()
{
// Set the value of the double-buffering style bits to true.
this->SetStyle( static_cast<ControlStyles>(ControlStyles::DoubleBuffer | ControlStyles::UserPaint | ControlStyles::AllPaintingInWmPaint), true );
this->UpdateStyles();
}
C#
public void EnableDoubleBuffering()
{
// Set the value of the double-buffering style bits to true.
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint,
true);
this.UpdateStyles();
}
Public Sub EnableDoubleBuffering()
' Set the value of the double-buffering style bits to true.
Me.SetStyle(ControlStyles.DoubleBuffer _
Or ControlStyles.UserPaint _
Or ControlStyles.AllPaintingInWmPaint, _
True)
Me.UpdateStyles()
End Sub
このメソッドは、適用する CreateParams スタイルを取得するメソッドを呼び出します。 コントロールCreateParamsのプロパティにStyle割り当てられているスタイルとExStyleプロパティCreateParamsが再適用されます。 必要に応じて、スタイルの変更を反映するようにコントロールが再描画されます。
UpdateStylesプロパティ値false
が IsHandleCreated .
製品 | バージョン |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |