VisualStyleInformation Sınıf

Tanım

İşletim sisteminin geçerli görsel stili hakkında bilgi sağlar.

C#
public static class VisualStyleInformation
Devralma
VisualStyleInformation

Örnekler

Aşağıdaki kod örneği, bir ListView denetimdeki özelliklerin VisualStyleInformation değerlerini görüntüler.

C#
// This is a simple example for VisualStyleInformation that displays
// all of the visual style values in a ListView.

using System;
using System.Drawing;
using System.Text;
using System.Reflection;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;

namespace VisualStyleInformationSample
{
    public class Form1 : Form
    {
        private ListView listView1 = new ListView();

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new Form1());
        }

        public Form1()
        {
            this.ClientSize = new Size(500, 500);
            this.Text = "VisualStyleInformation Property Values";

            listView1.Bounds = new Rectangle(new Point(10, 10),
                new Size(400, 300));
            listView1.View = View.Details;
            listView1.FullRowSelect = true;
            listView1.Sorting = SortOrder.Ascending;

            Type typeInfo = typeof(VisualStyleInformation);
            StringBuilder name = new StringBuilder();
            object propertyValue;

            // Declare an array of static/Shared property details for the
            // VisualStyleInformation class.
            PropertyInfo[] elementProperties =
                typeInfo.GetProperties(BindingFlags.Static | BindingFlags.Public);

            // Insert each property name and value into the ListView.
            foreach (PropertyInfo property in elementProperties)
            {
                name.Append(property.Name);
                propertyValue = property.GetValue(null,
                    BindingFlags.Static, null, null, null);
                ListViewItem newItem = new ListViewItem(name.ToString(), 0);
                newItem.SubItems.Add(propertyValue.ToString());
                listView1.Items.Add(newItem);
                name.Remove(0, name.Length);
            }

            // Create columns for the items and subitems.
            listView1.Columns.Add("Property", -2, System.Windows.Forms.HorizontalAlignment.Left);
            listView1.Columns.Add("Value", -2, System.Windows.Forms.HorizontalAlignment.Left);

            // Add the ListView to the control collection.
            this.Controls.Add(listView1);
        }
    }
}

Açıklamalar

Bu sınıf, işletim sisteminin geçerli görsel stili hakkında ayrıntılı bilgi sağlayan özellikleri kullanıma sunar static .

Özellikler

Author

Geçerli görsel stilinin yazarını alır.

ColorScheme

Geçerli görsel stilinin renk düzenini alır.

Company

Geçerli görsel stilini oluşturan şirketi alır.

ControlHighlightHot

Geçerli görsel stilinin denetimin etkin durumunu belirtmek için kullandığı rengi alır.

Copyright

Geçerli görsel stilinin telif hakkını alır.

Description

Geçerli görsel stilinin açıklamasını alır.

DisplayName

Geçerli görsel stilinin görünen adını alır.

IsEnabledByUser

Kullanıcının işletim sisteminde görsel stilleri etkinleştirip etkinleştirmediğini belirten bir değer alır.

IsSupportedByOS

İşletim sisteminin görsel stilleri destekleyip desteklemediğini belirten bir değer alır.

MinimumColorDepth

Geçerli görsel stili için en düşük renk derinliğini alır.

Size

Geçerli görsel stilinin boyutunu açıklayan bir dize alır.

SupportsFlatMenus

Geçerli görsel stilinin düz menüleri destekleyip desteklemediğini belirten bir değer alır.

TextControlBorder

Geçerli görsel stilinin metin içeren denetimlerin kenarlıklarını boyamak için kullandığı rengi alır.

Url

Geçerli görsel stilinin yazarı tarafından sağlanan url'yi alır.

Version

Geçerli görsel stilinin sürümünü alır.

Şunlara uygulanır

Ürün Sürümler
.NET Framework 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, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Ayrıca bkz.