Condividi tramite


Control.UpdateStyles Metodo

Definizione

Forza la riapplicazione degli stili assegnati al controllo.

protected:
 void UpdateStyles();
protected void UpdateStyles();
member this.UpdateStyles : unit -> unit
Protected Sub UpdateStyles ()

Esempio

Nell'esempio di codice seguente viene abilitato il doppio buffering in un Form oggetto e vengono aggiornati gli stili in modo da riflettere le modifiche.

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();
   }
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

Commenti

Questo metodo chiama il CreateParams metodo per ottenere gli stili da applicare. Gli stili assegnati alle Style proprietà e ExStyle dell'oggetto CreateParams assegnato alla proprietà del CreateParams controllo vengono riapplicati. Il controllo viene ridisegnato per riflettere le modifiche dello stile, se necessario.

Il UpdateStyles metodo non ha alcun effetto se il valore della IsHandleCreated proprietà è false.

Si applica a

Vedi anche