DrawThemeText

C# Signature:

[DllImport("uxtheme", ExactSpelling=true, CharSet=CharSet.Unicode)]
public extern static Int32 DrawThemeText(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, String text, int textLength, UInt32 textFlags, UInt32 textFlags2, ref RECT pRect);

VB .NET Signature:

<DllImport("uxtheme", ExactSpelling := True, CharSet := CharSet.Unicode)> _
Public Shared Function DrawThemeText(ByVal hTheme As IntPtr, ByVal hdc As IntPtr, ByVal iPartId As Integer, ByVal iStateId As Integer, ByVal text As String, ByVal textLength As Integer, ByVal textFlags As UInt32, ByVal textFlags2 As UInt32, ByRef pRect As RECT) As Int32
End Function

Sample Code:

Imports System.Runtime.InteropServices

    ' Make sure Themes are enabled in the application
    Public Sub New()
        MyBase.New()

        ' Enable WindowsXP Themes without a manifest file
        System.Windows.Forms.Application.EnableVisualStyles()
        System.Windows.Forms.Application.DoEvents()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call
    End Sub

Sample Code:

Sample Code:

Última actualización