Thursday, 19 September 2013

DLL issue. C# not recognizing DLL file, or its just me

DLL issue. C# not recognizing DLL file, or its just me

I'm assigned a task to use a DLL file in C#. I have created the DLL file
(Prog1210.dll) and have added it as a reference into the Solution explorer
in C#. The DLL file has a variable txtNumber1 which is trying to be
accessed in this main class.
Just wondering why it recognizes ValidateTextbox in the DLL in this class
form, but says it doesn't recognize Prog1210 in the using statement, and
doesn't recognize txtNumber1.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Prog1210;
namespace StaticClass
{
class Class1
{
private void btnValidate_Click(object sender, EventArgs e)
{
// Use the ValidateTexbox class that has been added to this project
if (ValidateTextbox.IsPresent(txtNumber1) &&
ValidateTextbox.IsDouble(txtNumber1) &&
ValidateTextbox.IsWithinRange(txtNumber1, 1.0, 100.0))
{
MessageBox.Show("Textbox value is valid!", "Good Data");
}
else
{
// The ValidateTexbox methods assigns an error message to the Tag
// property of the textbox.
string display = (string)txtNumber1.Tag;
MessageBox.Show(display, "Bad Data");
txtNumber1.Focus();
}
}
}
}`

No comments:

Post a Comment