我有一个绑定到List<string>. 我想将初始化后的可见文本设置为String.Empty.
问题是,无论我做什么,初始化控件后的文本始终是我的 List 的第一个条目(这是预期的,但我无法清除这个预选的文本)。
这是我的相关代码:
    public frmPricelist(Pricelist pricelist)
    {
        _pricelist = pricelist;
        InitializeComponent();
        Init();
    }
    private void Init()
    {
        cmbHersteller.Items.Clear();
        cmbHersteller.ComboBox.DataSource = _pricelist.GetHersteller();
        Application.DoEvents(); // Inserted for testing purposes
        cmbHersteller.ComboBox.SelectedText = String.Empty; // does not change the value
        cmbHersteller.ComboBox.Text         = String.Empty; // does not change the value            
    }
也许我只是为了树木而想念森林,但我根本无法让它发挥作用:)。