Imports System.ComponentModel Imports System.Runtime.InteropServices <ToolboxBitmap(GetType(Button))> <DefaultEvent("Click")> Public Class CommandLink Inherits Button Public Sub New() End Sub Protected Overrides ReadOnly Property CreateParams As CreateParams Get Const BS_COMMANDLINK As Integer = &HE Dim p = MyBase.CreateParams p.Style = p.Style Or BS_COMMANDLINK Return p End Get End Property End Class
#Region "SupplementalExplanation / 補足テキスト" ''' <summary> ''' 補足テキスト ''' </summary> ''' <returns></returns> <Category("Appearance")> <Description("補足テキスト")> <DefaultValue("")> Public Property SupplementalExplanation As String Get Return _SupplementalExplanation End Get Set(value As String) Const BCM_SETNOTE As Integer = 5641 _SupplementalExplanation = value SendMessage(New HandleRef(Me, Me.Handle), BCM_SETNOTE, IntPtr.Zero, value) End Set End Property Private _SupplementalExplanation As String = "" #End Region #Region "UACShield / UAC シールドアイコン" ''' <summary> ''' UAC シールドアイコン ''' </summary> ''' <returns></returns> <Category("Appearance")> <Description("UAC シールドアイコン")> <DefaultValue(False)> Public Property UACShield As Boolean Get Return _UACShield End Get Set(value As Boolean) Const BCM_SETSHIELD As Integer = 5644 _UACShield = value SendMessage(New HandleRef(Me, Me.Handle), BCM_SETSHIELD, IntPtr.Zero, New IntPtr(If(value, 1, 0))) End Set End Property Private _UACShield As Boolean = False #End Region Private Declare Auto Function SendMessage Lib "user32" (hwnd As HandleRef, msg As Integer, wParam As IntPtr, lParam As IntPtr) As IntPtr Private Declare Auto Function SendMessage Lib "user32" (hwnd As HandleRef, msg As Integer, wParam As IntPtr, lParam As String) As IntPtr