VisualStyleRenderer Konstruktorok
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Inicializálja a VisualStyleRenderer osztály új példányát.
Túlterhelések
| Név | Description |
|---|---|
| VisualStyleRenderer(VisualStyleElement) |
Inicializálja az osztály új példányát a VisualStyleRenderer megadott VisualStyleElement. |
| VisualStyleRenderer(String, Int32, Int32) |
Inicializálja az osztály új példányát az VisualStyleRenderer adott osztály, rész és állapotértékek használatával. |
VisualStyleRenderer(VisualStyleElement)
- Forrás:
- VisualStyleRenderer.cs
- Forrás:
- VisualStyleRenderer.cs
- Forrás:
- VisualStyleRenderer.cs
- Forrás:
- VisualStyleRenderer.cs
- Forrás:
- VisualStyleRenderer.cs
Inicializálja az osztály új példányát a VisualStyleRenderer megadott VisualStyleElement.
public:
VisualStyleRenderer(System::Windows::Forms::VisualStyles::VisualStyleElement ^ element);
public VisualStyleRenderer(System.Windows.Forms.VisualStyles.VisualStyleElement element);
new System.Windows.Forms.VisualStyles.VisualStyleRenderer : System.Windows.Forms.VisualStyles.VisualStyleElement -> System.Windows.Forms.VisualStyles.VisualStyleRenderer
Public Sub New (element As VisualStyleElement)
Paraméterek
- element
- VisualStyleElement
Egy VisualStyleElement , amit ez VisualStyleRenderer képviselni fog.
Kivételek
Az operációs rendszer nem támogatja a vizuális stílusokat.
-vagy-
A vizuális stílusokat a felhasználó letiltja az operációs rendszerben.
-vagy-
A vizualizációs stílusok nincsenek alkalmazva az alkalmazásablakok ügyfélterületére.
element nem az aktuális vizualizációs stílus határozza meg.
Példák
Az alábbi példakód bemutatja, hogyan hozhat létre egy VisualStyleRenderer(VisualStyleElement) konstruktort VisualStyleRenderer. Ez a példakód egy nagyobb, az VisualStyleRenderer osztály áttekintéséhez megadott kód példája.
// Set the VisualStyleRenderer to a new element.
private:
bool SetRenderer(VisualStyleElement^ element)
{
if (!VisualStyleRenderer::IsElementDefined(element))
{
return false;
}
if (renderer == nullptr)
{
renderer = gcnew VisualStyleRenderer(element);
}
else
{
renderer->SetParameters(element);
}
return true;
}
// Set the VisualStyleRenderer to a new element.
private bool SetRenderer(VisualStyleElement element)
{
if (!VisualStyleRenderer.IsElementDefined(element))
{
return false;
}
if (renderer == null)
{
renderer = new VisualStyleRenderer(element);
}
else
{
renderer.SetParameters(element);
}
return true;
}
' Set the VisualStyleRenderer to a new element.
Private Function SetRenderer(ByVal element As _
VisualStyleElement) As Boolean
If Not VisualStyleRenderer.IsElementDefined(element) Then
Return False
End If
If renderer Is Nothing Then
renderer = New VisualStyleRenderer(element)
Else
renderer.SetParameters(element)
End If
Return True
End Function
Megjegyzések
Ez a konstruktor a VisualStyleElement.ClassNameparaméter , VisualStyleElement.Partés VisualStyleElement.State tulajdonságai element alapján inicializálja a , Classés Part tulajdonságokatState.
A konstruktor használata előtt hívja meg a staticIsElementDefined metódust annak ellenőrzéséhez, hogy az aktuális vizualizációs stílus definiálja-e a element paraméter által megadott elemet.
A következőre érvényes:
VisualStyleRenderer(String, Int32, Int32)
- Forrás:
- VisualStyleRenderer.cs
- Forrás:
- VisualStyleRenderer.cs
- Forrás:
- VisualStyleRenderer.cs
- Forrás:
- VisualStyleRenderer.cs
- Forrás:
- VisualStyleRenderer.cs
Inicializálja az osztály új példányát az VisualStyleRenderer adott osztály, rész és állapotértékek használatával.
public:
VisualStyleRenderer(System::String ^ className, int part, int state);
public VisualStyleRenderer(string className, int part, int state);
new System.Windows.Forms.VisualStyles.VisualStyleRenderer : string * int * int -> System.Windows.Forms.VisualStyles.VisualStyleRenderer
Public Sub New (className As String, part As Integer, state As Integer)
Paraméterek
- className
- String
Annak az elemnek az osztályneve, amelyet ez VisualStyleRenderer jelölni fog.
- part
- Int32
Az elem azon része, amelyet ez VisualStyleRenderer jelölni fog.
- state
- Int32
Annak az elemnek az állapota, amelyet ez VisualStyleRenderer jelölni fog.
Kivételek
Az operációs rendszer nem támogatja a vizuális stílusokat.
-vagy-
A vizuális stílusokat a felhasználó letiltja az operációs rendszerben.
-vagy-
A vizualizációs stílusok nincsenek alkalmazva az alkalmazásablakok ügyfélterületére.
A ( ) classNamekombináció, partés state nem az aktuális vizualizációs stílus határozza meg.
.NET 5-ös és újabb: classNamenull.
Megjegyzések
Ez a konstruktor a className, partés state a paraméterek használatával inicializálja a , Classés Part a Statetulajdonságokat.
A konstruktor használata előtt hívja meg a staticIsElementDefined metódust annak ellenőrzéséhez, hogy az aktuális vizualizációs stílus definiálja-e a className, partés state paraméterek által megadott elemet.