如何让我的 sphereGUI.cs 使用 MyMath.cs?
这是写在 sphereGUI.cs 表单上的代码行if (TriMath.IsNumeric(textBox1.Text) == true)
以下是错误消息: 错误 The name 'TriMath' does not exist in the current context C:\Workspace\Cisc-2330-Labs\Lab6\Lab6\sphereGUI.cs 24 11 实验室6
如何让我的 sphereGUI.cs 使用 MyMath.cs?
这是写在 sphereGUI.cs 表单上的代码行if (TriMath.IsNumeric(textBox1.Text) == true)
以下是错误消息: 错误 The name 'TriMath' does not exist in the current context C:\Workspace\Cisc-2330-Labs\Lab6\Lab6\sphereGUI.cs 24 11 实验室6
Make sure they are in same Namespace
For Form1.cs it should be
namespace Lab6
{
class Form1:Form
{
//....
}
}
For MyMath.cs
namespace Lab6
{
class MyMath
{
//....
}
}
Hey just check out this statement,
if (TriMath.IsNumeric(textBox1.Text) == true
Your class Name is MyMath
according to snap and you are using TriMath
?
Make sure the namespace is correct
Make Sure that the references required is added in the header section (like using...)
确保包含一个从其命名空间中获取类的 using 语句。