我对C#非常陌生,有一个问题。我可以通过将按钮的FlatStyle更改为“Flat”来更改其边框颜色。但是在使用NumericUpDown
时,我无法更改FlatStyle。我仍然希望能够使用上下箭头,因此仅使用其他方法来覆盖边缘是不起作用的。以下是我在代码中简化后的版本:
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace bordertest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
BackColor = Color.Black;
numericUpDown1.BackColor = Color.Red;
}
}
}