Control.UpdateStyles Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Força a reaplicação dos estilos atribuídos ao controlo.
protected:
void UpdateStyles();
protected void UpdateStyles();
member this.UpdateStyles : unit -> unit
Protected Sub UpdateStyles ()
Exemplos
O exemplo de código seguinte permite o double-buffering num Form e atualiza os estilos para refletir as alterações.
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
Observações
Este método chama o CreateParams método para aplicar os estilos. Os estilos atribuídos às Style propriedades e ExStyle da CreateParams propriedade atribuída à propriedade do CreateParams controlo são reaplicados. O controlo é repintado para refletir as alterações de estilo, se necessário.
O UpdateStyles método não tem efeito se o IsHandleCreated valor da propriedade for false.