C#不包含"DashboardTab"的定义,也没有扩展方法 [英] C# does not contain a definition for 'DashboardTab' and no extension method
问题描述
你好
我在项目中遇到此错误吗?错误:"Login_Viper_Safe.Dashboard"不包含"DashboardTab"的定义,并且找不到扩展方法"DashboardTab"接受类型为"Login_Viper_Safe.Dashboard"的第一个参数(丢失了吗? using指令还是程序集引用?)
Am I getting this error on my project? ERROR: 'Login_Viper_Safe.Dashboard' does not contain a definition for 'DashboardTab' and no extension method 'DashboardTab' accepting a first argument of type 'Login_Viper_Safe.Dashboard' could be found (are you missing a using directive or an assembly reference?)
这是我的代码:)
公共局部类仪表板:表格
{
Public bool可见的{get;放; }
公共仪表板()
{
InitializeComponent();
}
受保护的覆盖无效WndProc(参考消息m)
{
base.WndProc(ref m);
如果(m.Msg == WM_NCHITTEST)
m.Result =(IntPtr)(HT_CAPTION);
}
私有const int WM_NCHITTEST = 0x84;
私有const int HT_CLIENT = 0x1;
私有const int HT_CAPTION = 0x2;
私人void b1_Click(对象发送者,EventArgs e)
{
this.DashboardTab.Visible = true; (EEEOR HERE)
}
private void b2_Click(对象发送者,EventArgs e)
{
}
私人空白b3_Click(对象发送者,EventArgs e)
{
}
}
}
public partial class Dashboard : Form
{
public bool Visible { get; set; }
public Dashboard()
{
InitializeComponent();
}
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_NCHITTEST)
m.Result = (IntPtr)(HT_CAPTION);
}
private const int WM_NCHITTEST = 0x84;
private const int HT_CLIENT = 0x1;
private const int HT_CAPTION = 0x2;
private void b1_Click(object sender, EventArgs e)
{
this.DashboardTab.Visible = true; (EEEOR HERE)
}
private void b2_Click(object sender, EventArgs e)
{
}
private void b3_Click(object sender, EventArgs e)
{
}
}
}
推荐答案
这意味着您的 Dashboard 表单不包含任何称为"DashboardTab"的控件或变量.在表单设计器"中检查控件的名称,并使用适当的名称.
It means that your Dashboard form does not contain any control or variable called "DashboardTab". Check the name of controls in Form Designer and use the appropriate name.
这篇关于C#不包含"DashboardTab"的定义,也没有扩展方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!