在 C# 中,使用按钮将 2 个 ComboBoxes 中的选择多次附加到 TextBox 中

in C#, Append selection multiple times from 2 ComboBoxes into a TextBox using a button

我正在尝试通过单击按钮将 2 个 ComboBox 中的选择附加到 TextBox 中,但我不确定如何执行此操作。我可以用这样的代码做一次:

 private void BTN_APPEND_Click(object sender, EventArgs e)
    {
        TB_CONNECTORS.Text = CB_PORT_NUMBER.Text + " " + CB_CONNECTOR.Text;
    }

这将导致 Append with the click of a button

但问题是,我怎样才能再追加一次?

你试过这个吗:

 if(!TB_CONNECTORS.Text == "")
 {
 TB_CONNECTORS.Text = TB_CONNECTORS.Text + " & " + CB_PORT_NUMBER.Text + " " + CB_CONNECTOR.Text;
 }
 else
 {
 TB_CONNECTORS.Text = CB_PORT_NUMBER.Text + " " + CB_CONNECTOR.Text;
 }

这将导致从 2 个组合框获得的新值保留文本框的现有文本