一、DropDownStyle设置为DropDownList
然后设置 FlatStyle 的属性
二、
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern IntPtr GetWindow(IntPtr hWnd, int uCmd);
public const int GW_CHILD = 5;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
public const int EM_SETREADONLY = 0xcf;
然后在构造函数中设置消息
public FrmNotamSequence()
{
InitializeComponent();
IntPtr editHandle = GetWindow(((ComboBox)item)/(控件的名字).Handle, GW_CHILD);
SendMessage(editHandle, EM_SETREADONLY, 1, 0);
}