When i open my project , any form contained my class is noticed with errors , some of that are like this :
|
| Could not find type
'ERP2010_11.Class.Class_GPPanel'. Please make sure that the assembly that
contains this type is referenced. If this type is a part of your development
project, make sure that the project has been successfully built.
| ||||||||
MinhPosted Jun 10, 2010, 1:14 PM
MinhPosted Jun 10, 2010, 11:48 AM
Below is one of my classes , In Form1 , I declare an object textbox named textbox1 on this class and The error was shown .
public class MyNumText : DevComponents.DotNetBar.Controls.TextBoxX
{
protected override void OnTextChanged(EventArgs e)
{
// TextBox t = (TextBox)sender;
if (this.Tag != null && this.Tag.ToString() == "0") return;
String Text = this.Text;
int selStart = this.SelectionStart;
int commaCount_Before = 0;
int commaCount_After = 0;
for (int i = 0; i < Text.Length; i++)
{
if (Text.Substring(i, 1) == ",")
{
commaCount_Before++;
}
}
Decimal Num;
Text = Text.Replace(",", "");
if (Decimal.TryParse(Text, out Num))
{
Text = String.Format("{0:N0}", Num);
this.Text = Text;
}
for (int i = 0; i < Text.Length; i++)
{
if (Text.Substring(i, 1) == ",")
{
commaCount_After++;
}
}
int diff = (commaCount_After - commaCount_Before);
if (diff >= 0)
{
this.SelectionStart = selStart + (commaCount_After - commaCount_Before);
}
base.OnTextChanged(e);
}
protected override void OnLeave(EventArgs e)
{
String Text = this.Text.Replace(",", "");
int Num;
if (int.TryParse(Text, out Num))
{
Text = String.Format("{0:N0}", Num);
this.Text = Text;
}
base.OnLeave(e);
}
protected override void OnKeyDown(KeyEventArgs e)
{
//TextBox t = sender as TextBox;
bool FirstTime = false;
if (e.KeyCode == Keys.Delete || e.KeyCode == Keys.Back)
{
if (this.Text.Contains(",") == true)
{
FirstTime = true;
}
else
{
return;
}
}
if (e.KeyCode == Keys.Back)
{
int commaCount = 0;
this.Tag = "0";
int selStart = this.SelectionStart;
for (int i = 0; i < selStart; i++)
{
if (this.Text.Substring(i, 1) == ",")
{
commaCount++;
}
}
this.Text = this.Text.Replace(",", "");
selStart -= commaCount;
if (selStart >= 0)
{
this.SelectionStart = selStart;
}
}
else if (e.KeyCode == Keys.Delete)
{
int commaCount = 0;
this.Tag = "0";
int selStart = this.SelectionStart;
for (int i = 0; i < selStart; i++)
{
if (this.Text.Substring(i, 1) == ",")
{
commaCount++;
}
}
this.Text = this.Text.Replace(",", "");
selStart += commaCount;
selStart -= 3;
if (selStart >= 0)
{
this.SelectionStart = selStart;
}
}
else
{
this.Tag = "";
}
if (FirstTime)
{
e.Handled = true;
return;
}
base.OnKeyDown(e);
}
} // Text box kieu so
Jaish MathewsPosted Jun 10, 2010, 11:30 AM
U need to share ur class and form code to get an idea
MinhPosted Jun 10, 2010, 11:29 AM
Mahesh ChandPosted Jun 10, 2010, 11:23 AM
You may also be using a different version of a product.