0

如何让我的 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

探险家

4

3 回答 3

0

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
    {
        //....
    }
}
于 2012-04-26T11:14:52.387 回答
0

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?

  1. Make sure the namespace is correct

  2. Make Sure that the references required is added in the header section (like using...)

于 2012-04-26T11:16:35.737 回答
0

确保包含一个从其命名空间中获取类的 using 语句。

于 2012-04-26T11:31:06.453 回答