我试图检查datagridview单元格的空值和空值...但我不能正确...
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if ((String)dataGridView1.Rows[i].Cells[3].Value == String.Empty)
{
MessageBox.Show(" cell is empty");
return;
}
if ((String)dataGridView1.Rows[i].Cells[3].Value == "")
{
MessageBox.Show("cell in empty");
return ;
}
}
Run Code Online (Sandbox Code Playgroud)
我甚至试过这个代码
if (String.IsNullOrEmpty(dataGridView1.Rows[i].Cells[3].Value))
{
MessageBox.Show("cell is empty");
return;
}
Run Code Online (Sandbox Code Playgroud)
谁能帮我这个...
我正在使用窗口应用程序和C#..我有一张在应用程序开始时看不见的图片..当点击某个按钮时,必须显示图片框..
我使用这种编码,但图片框不可见
private void save_click(object sender, EventArgs e)
{
pictureBox1.Visible = true;
pictureBox1.Show();
//does the work here
//storing and retreiving values from datadase
pictureBox1.Visible = false;
pictureBox1.Hide();
}
Run Code Online (Sandbox Code Playgroud)
PS ..在图片框中我显示了一个gif ..所以用户会知道一些工作正在后台进行..这个功能需要很长时间才能完成...
我试图突出(使用C#在selenium webdriver中找到的元素).我搜索网上所有我发现的是java代码,但需要它在C#中.
或者还有其他方法可以做到这一点.
谢谢
我试图将DataGridView单元格转换为控件:
Control dat = new Control();
dat = Convert.ChangeType(dataGridView1[colIndex,rowIndex], typeof(Control));
Run Code Online (Sandbox Code Playgroud)
我从索引代码中获取colIndex和rowIndes的值.问题是即使我尝试了很多代码来转换,它也行不通.
我得到的例外是:
无法将对象隐式转换为控件.存在显式转换(你是否错过了演员?)