将组合框的显示值分配给另一个文本

Assign display value from a combo box to another text

我有显示组合框的代码,例如

da.Fill(ds1, "HDTYPE");
comboHD.DisplayMember = "hw_define";
comboHD.ValueMember = "hwd_Id";
comboHD.DataSource = ds1.Tables["HDTYPE"];

问题是我想将选定的文本分配给另一个文本字段,即 hw_define 用于打印数据,将 hwd_Id 分配给数据库用于保存数据。我可以使用 hwtype.SelectedValue 获取选定的 ID (hwd_id)。 但是我怎样才能被选中 - hw_define text to assign another text box?

您可以使用 comboHD.Text 获取组合框中显示的值。