我想在事件datagridview
上获取tab_SelectedIndexChanged
名称
如下所示,但我收到错误消息
无法转换为' string'到' System.Windows.Forms.DataGridView'
无论如何,我可以帮助我
public static string Selected_dgvName;
private void tab_SelectedIndexChanged(object sender, EventArgs e)
{
Selected_dgvName = tab.TabPages[tab.SelectedIndex].Name;
}
答案 0 :(得分:0)
public static string Selected_dgvName;
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
Selected_dgvName = tabControl1.SelectedTab.Name;
}
请检查您的标签名称,