如果值相同,则将组合框选定项与textbox1进行比较 [英] Comparing a combobox selected item with textbox1 if value same
问题描述
比较组合框所选项目与textbox1如果值相同
那么这应该显示
MessageBox.Show(Duplicate Entry, OK!,MessageBoxButtons.OK,MessageBoxIcon.Information);
文本框从listview1列读取
然后必须比较值是否是一样的
然后我只能
激活btnSave
< b>我尝试了什么:
if(CboBINinout.SelectedItem == txtINOUT.Text)
{
btnOUT.Enabled = false;
}
Comparing a combobox selected item With textbox1 if value same
then this should show
MessageBox.Show("Duplicate Entry", "OK!", MessageBoxButtons.OK, MessageBoxIcon.Information);
the textbox reads from listview1 columns
then must compare if the values are the same
then i can only
activate btnSave
What I have tried:
if (CboBINinout.SelectedItem == txtINOUT.Text)
{
btnOUT.Enabled = false;
}
推荐答案
尝试:
Try:
if (CboBINinout.SelectedText == txtINOUT.Text)
{
btnOUT.Enabled = false;
}
if(CboBINinout.SelectedItem.ToString()。Trim()== txtINOUT.Text)
{
bnnOUT.Enabled = false;
}
if(CboBINinout.SelectedItem.ToString()。Trim()!= txtINOUT.Text )
{
btnOUT.Enabled = true;
}
if (CboBINinout.SelectedItem.ToString().Trim() == txtINOUT.Text)
{
btnOUT.Enabled = false;
}
if (CboBINinout.SelectedItem.ToString().Trim() != txtINOUT.Text)
{
btnOUT.Enabled = true;
}
这篇关于如果值相同,则将组合框选定项与textbox1进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!