Here is an example implementation. As for the image, it can be extracted from ExplorerFrame.
The first attempt of this class simply flipped the button's FlatStyle when hovering, but the image shifted position whenever the button was hovered over.
Also, the class does not faithfully replicate that button in the flyout; it has a pressed state instead of shifting the image, and it also doesn't draw a dotted outline when it's active. That however goes against how buttons typically function in Windows, so this did not replicate the behaviour.
public class FlyoutImageButton : Button
{
bool _isHovering = false;
public FlyoutImageButton() : base()
{
MouseEnter += (sender, e) => _isHovering = true;
MouseLeave += (sender, e) => _isHovering = false;
}
protected override void OnPaint(PaintEventArgs e)
{
if (_isHovering)
base.OnPaint(e);
else
{
if (this.Image != null)
{
e.Graphics.Clear(BackColor);
if (this.Enabled)
e.Graphics.DrawImageUnscaled(
this.Image,
(this.Width - this.Image.Width) / 2,
(this.Height - this.Image.Height) / 2);
else
ControlPaint.DrawImageDisabled(
e.Graphics,
this.Image,
(this.Width - this.Image.Width) / 2,
(this.Height - this.Image.Height) / 2,
BackColor);
}
if (this.DesignMode)
ControlPaint.DrawBorder(
e.Graphics, ClientRectangle, SystemColors.ControlDarkDark, ButtonBorderStyle.Dashed);
}
}
}