The hot track appearance works fine when the FlatBorderless Button Style is used, but for some reason you can't have it with a border. Is this intentional behaviour? Is there any workaround other than using the MouseEnter and MouseLeave events to do it manually?
Here's the designer code to show how I've got it configured:
' 'ActionButton ' Me.ActionButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Appearance17.BackColor = System.Drawing.Color.Transparent Appearance17.BorderColor = System.Drawing.Color.FromArgb(CType(CType(180, Byte), Integer), CType(CType(165, Byte), Integer), CType(CType(85, Byte), Integer)) Me.ActionButton.Appearance = Appearance17 Me.ActionButton.ButtonStyle = Infragistics.Win.UIElementButtonStyle.Flat Me.ActionButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Appearance18.BackColor = System.Drawing.Color.FromArgb(CType(CType(254, Byte), Integer), CType(CType(248, Byte), Integer), CType(CType(216, Byte), Integer)) Appearance18.BackColor2 = System.Drawing.Color.FromArgb(CType(CType(253, Byte), Integer), CType(CType(239, Byte), Integer), CType(CType(169, Byte), Integer)) Appearance18.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical Appearance18.BorderColor = System.Drawing.Color.FromArgb(CType(CType(180, Byte), Integer), CType(CType(165, Byte), Integer), CType(CType(85, Byte), Integer)) Me.ActionButton.HotTrackAppearance = Appearance18 Me.ActionButton.Location = New System.Drawing.Point(432, 3) Me.ActionButton.Name = "ActionButton" Appearance19.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(236, Byte), Integer), CType(CType(131, Byte), Integer)) Appearance19.BackColor2 = System.Drawing.Color.FromArgb(CType(CType(218, Byte), Integer), CType(CType(202, Byte), Integer), CType(CType(112, Byte), Integer)) Appearance19.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical Appearance19.BorderColor = System.Drawing.Color.FromArgb(CType(CType(180, Byte), Integer), CType(CType(165, Byte), Integer), CType(CType(85, Byte), Integer)) Me.ActionButton.PressedAppearance = Appearance19 Me.ActionButton.ShowFocusRect = False Me.ActionButton.ShowOutline = False Me.ActionButton.Size = New System.Drawing.Size(91, 22) Me.ActionButton.TabIndex = 13 Me.ActionButton.Text = "Undo" Me.ActionButton.UseOsThemes = Infragistics.Win.DefaultableBoolean.[False]
I seem to have the opposite issue to this. When I set the ButtonStyle to FlatBorderless, the button itself has no border. But the HotTracked appearance has a border. Is this a bug? Surely if I've set the style to borderless, this should apply to the hot tracked appearance also?
That worked, thanks.
Hello John,
Thank you for contacting Infragistics support.
In order to enable hot tracking of UltraButton you need to set UseHotTracking property to true. You can use code like this:
Me.ActionButton.UseHotTracking = Infragistics.Win.DefaultableBoolean.[True]
More about this property you may find by following the next link http://help.infragistics.com/Help/Doc/WinForms/2013.2/CLR4.0/html/Infragistics4.Win.Misc.v13.2~Infragistics.Win.Misc.ControlBase~UseHotTracking.html
Please let me know if you need any further assistance.