ComponentDesigner.OnSetComponentDefaults Metoda

Definicja

Przestroga

This method has been deprecated. Use InitializeNewComponent instead. http://go.microsoft.com/fwlink/?linkid=14202

Przestroga

This method has been deprecated. Use InitializeNewComponent instead. https://go.microsoft.com/fwlink/?linkid=14202

Ustawia domyślne właściwości składnika.

public:
 virtual void OnSetComponentDefaults();
public virtual void OnSetComponentDefaults ();
[System.Obsolete("This method has been deprecated. Use InitializeNewComponent instead.  http://go.microsoft.com/fwlink/?linkid=14202")]
public virtual void OnSetComponentDefaults ();
[System.Obsolete("This method has been deprecated. Use InitializeNewComponent instead.  https://go.microsoft.com/fwlink/?linkid=14202")]
public virtual void OnSetComponentDefaults ();
abstract member OnSetComponentDefaults : unit -> unit
override this.OnSetComponentDefaults : unit -> unit
[<System.Obsolete("This method has been deprecated. Use InitializeNewComponent instead.  http://go.microsoft.com/fwlink/?linkid=14202")>]
abstract member OnSetComponentDefaults : unit -> unit
override this.OnSetComponentDefaults : unit -> unit
[<System.Obsolete("This method has been deprecated. Use InitializeNewComponent instead.  https://go.microsoft.com/fwlink/?linkid=14202")>]
abstract member OnSetComponentDefaults : unit -> unit
override this.OnSetComponentDefaults : unit -> unit
Public Overridable Sub OnSetComponentDefaults ()
Atrybuty

Uwagi

OnSetComponentDefaults jest wywoływana po zainicjowaniu projektanta. Dzięki temu projektant może podać wartości domyślne dla podstawowego składnika.

Ta metoda jest wywoływana tylko raz: po pierwszym utworzeniu składnika przez przeciągnięcie go z przybornika do powierzchni projektowej. Kolejne inicjacje projektanta nie wywołują tej metody.

Domyślna implementacja tej metody ustawia domyślną właściwość składnika na nazwę składnika, jeśli właściwość domyślna jest ciągiem, a właściwość nie została jeszcze ustawiona. Tę metodę można zaimplementować w klasie pochodnej, aby dostosować inicjowanie składnika, który projektuje ten projektant.

Dotyczy