在wpf中怎样获得Combox的文本值
1个回答
展开全部
你试试这个。
private void Combobox_change(object sender, SelectionChangedEventArgs e)
{
try
{
string ss = "";
ss = ((System.Windows.Controls.ComboBoxItem)e.AddedItems[0]).Content.ToString();
(this.DataContext as ReportTheLossViewModel).SetEnable(ss);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
throw;
}
}
private void Combobox_change(object sender, SelectionChangedEventArgs e)
{
try
{
string ss = "";
ss = ((System.Windows.Controls.ComboBoxItem)e.AddedItems[0]).Content.ToString();
(this.DataContext as ReportTheLossViewModel).SetEnable(ss);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
throw;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询