SoFunction
Updated on 2025-03-06

C# uses reflection technology to achieve the effect of removing the border when button is selected

This article describes the effect of C# using reflection technology to achieve the effect of removing the border when the button is selected. Share it for your reference. The details are as follows:

public void HideFocusCues(Control control)
{
 Type vType = typeof(Control);
 FieldInfo vFieldInfo = ("uiCuesState",
   |  |
   |  |
  );
 (control, 15);
}
void rbt_Paint(object sender, PaintEventArgs e)
{
 HideFocusCues((Control)sender);
}

I hope this article will be helpful to everyone's C# programming.