using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace VistaRules { class CommandLinkButton : Button { // this version started at http://danielmoth.com/Blog public CommandLinkButton() { base.FlatStyle = FlatStyle.System; } private string helpText = ""; public string HelpText { get { return this.helpText; } set { Win32Api.SendMessage(this.Handle, 0x00001609, // BCM_SETNOTE IntPtr.Zero, value); this.helpText = value; } } protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.Style |= 0x0000000e; //BS_COMMANDLINK return cp; } } } public static class Win32Api { [DllImport("user32", CharSet = CharSet.Unicode)] internal static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, string lParam); } }