Click here to Skip to main content
14,766,986 members
Home » Discussions » C#
   

C#

 
AnswerRe: problem with registering flormclosing event with button click event Pin
musefan16-Jun-09 22:59
Membermusefan16-Jun-09 22:59 
AnswerRe: problem with registering flormclosing event with button click event Pin
DaveyM6916-Jun-09 23:04
professionalDaveyM6916-Jun-09 23:04 
GeneralRe: problem with registering flormclosing event with button click event Pin
prasadbuddhika16-Jun-09 23:29
Memberprasadbuddhika16-Jun-09 23:29 
GeneralRe: problem with registering flormclosing event with button click event Pin
prasadbuddhika17-Jun-09 0:58
Memberprasadbuddhika17-Jun-09 0:58 
AnswerRe: problem with registering flormclosing event with button click event [modified] Pin
Alan N17-Jun-09 1:10
MemberAlan N17-Jun-09 1:10 
GeneralRe: problem with registering flormclosing event with button click event Pin
DaveyM6917-Jun-09 1:10
professionalDaveyM6917-Jun-09 1:10 
GeneralRe: problem with registering flormclosing event with button click event Pin
OriginalGriff17-Jun-09 1:12
mveOriginalGriff17-Jun-09 1:12 
QuestionHelp me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
radhikasharma16-Jun-09 22:08
Memberradhikasharma16-Jun-09 22:08 
iam using windows application using csharp,iam design UI which will display the all characters of keyboard(lowercase,uppercase,symbols,special characters)I initialize the characters using folowing code:
code 1. private void InitializeCharacters(InkOverlay inkOverlay)
{
this.Add(new Character(inkOverlay, "0x20", "space", " ", CharClass.Hidden));
this.Add(new Character(inkOverlay, "0x21", "exclam", "!", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x22", "quotedbl", "\"", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x23", "numbersign", "#", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x24", "dollar", "$", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x25", "percent", "%", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x26", "ampersand", "&", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x27", "quotesingle", "'",CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x28", "parenleft", "(", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x29", "parenright", ")", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x2a", "asterisk", "*", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x2b", "plus", "+", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x2c", "comma", ",", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x2d", "hyphen", "-", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x2e", "period", ".", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x2f", "slash", "/", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x30", "zero", "0", CharClass.Number));
this.Add(new Character(inkOverlay, "0x31", "one", "1", CharClass.Number));
this.Add(new Character(inkOverlay, "0x32", "two", "2", CharClass.Number));
this.Add(new Character(inkOverlay, "0x33", "three", "3", CharClass.Number));
this.Add(new Character(inkOverlay, "0x34", "four", "4", CharClass.Number));
this.Add(new Character(inkOverlay, "0x35", "five", "5", CharClass.Number));
this.Add(new Character(inkOverlay, "0x36", "six", "6", CharClass.Number));
this.Add(new Character(inkOverlay, "0x37", "seven", "7", CharClass.Number));
this.Add(new Character(inkOverlay, "0x38", "eight", "8", CharClass.Number));
this.Add(new Character(inkOverlay, "0x39", "nine", "9", CharClass.Number));
this.Add(new Character(inkOverlay, "0x3a", "colon", ":", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x3b", "semicolon", ";", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x3c", "less", "<", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x3d", "equal", "=", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x3e", "greater", ">", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x4f", "question", "?", CharClass.Punctuation));
this.Add(new Character(inkOverlay, "0x40", "at", "@", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x41", "A", "A", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x42", "B", "B", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x43", "C", "C", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x44", "D", "D", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x45", "E", "E", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x46", "F", "F", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x47", "G", "G", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x48", "H", "H", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x49", "I", "I", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x4a", "J", "J", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x4b", "K", "K", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x4c", "L", "L", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x4d", "M", "M", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x4e", "N", "N", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x4f", "O", "O", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x50", "P", "P", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x51", "Q", "Q", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x52", "R", "R", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x53", "S", "S", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x54", "T", "T", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x55", "U", "U", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x56", "V", "V", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x57", "W", "W", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x58", "X", "X", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x59", "Y", "Y", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x5a", "Z", "Z", CharClass.Uppercase));
this.Add(new Character(inkOverlay, "0x5b", "bracketleft", "[", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x5c", "backslash", @"\", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x5d", "bracketright", "]", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x5e", "asciicircum", "^", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x5f", "underscore", "_", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x60", "grave", "`", CharClass.Notdef));
this.Add(new Character(inkOverlay, "0x61", "a", "a", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x62", "b", "b", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x63", "c", "c", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x64", "d", "d", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x65", "e", "e", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x66", "f", "f", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x67", "g", "g", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x68", "h", "h", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x69", "i", "i", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x6a", "j", "j", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x6b", "k", "k", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x6c", "l", "l", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x6d", "m", "m", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x6e", "n", "n", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x6f", "o", "o", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x70", "p", "p", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x71", "q", "q", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x72", "r", "r", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x73", "s", "s", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x74", "t", "t", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x75", "u", "u", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x76", "v", "v", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x77", "w", "w", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x78", "x", "x", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x79", "y", "y", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x7a", "z", "z", CharClass.Lowercase));
this.Add(new Character(inkOverlay, "0x7b", "braceleft", "{", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x7c", "bar", "Signature ", CharClass.Signature));
this.Add(new Character(inkOverlay, "0x7d", "braceright", "}", CharClass.Symbol));
this.Add(new Character(inkOverlay, "0x7e", "asciitilde", "~", CharClass.Symbol));
}
///Above code works fine... i have used picturebox control to draw the writing area

private void drawWritingArea()
{
this.drawWritingArea(this.picBoxCharacters.Width);
}

///The error comes here when it goes into for each loop for each charset, from the code1 i get the all characters into charset it there works fine but during FOR LOOP it gives me error at charset (Stack overflow execption , please suggest me how to resolve it)//

private void drawWritingArea(int bitmapWidth)
{
Application.DoEvents();
CharClass[] classArray2 = new CharClass[6];
classArray2[1] = CharClass.Uppercase;
classArray2[2] = CharClass.Number;
classArray2[3] = CharClass.Punctuation;
classArray2[4] = CharClass.Symbol;
classArray2[5] = CharClass.Signature;
CharClass[] classArray = classArray2;
int num = 0x20;
int num2 = num / 4;
int num3 = num / 2;
int num4 = 13;
int num5 = 0x37;
int num6 = 10;
int num7 = 10;
double num8 = double.Parse(this.lblZoomFactor.Text) / 100.0;
int num9 = (int)(num * num8);
int num10 = (int)(num2 * num8);
int num11 = (int)(num3 * num8);
int width = (int)(num5 * num8);
int num13 = (int)(num6 * num8);
int height = ((num4 + num9) + num10) + num11;
int num15 = ((bitmapWidth - 0x10) - (2 * num13)) / width;
int num16 = (bitmapWidth - (2 * num6)) - (width * num15);
num16 /= 2;
int num17 = 0;
Label_0104:
foreach (Character character in this.charSet)///Error of stack overflow execption in Charset//
{
foreach (CharClass class2 in classArray)
{
if (character.type == class2)
{
num17++;
goto Label_0104;
}
}
}
int num18 = (num17 / num15) + 4;
if (this.breakCharTypes)
{
num18 += 2;
}
int num19 = num18 * (height + num13);
Bitmap image = new Bitmap(bitmapWidth, num19, PixelFormat.Format32bppArgb);
this.picBoxCharacters.Height = num19;
Graphics graphics = Graphics.FromImage(image);
graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
Brush brush = new SolidBrush(Color.LightYellow);
Pen pen = new Pen(Color.LightSteelBlue);
Pen pen2 = new Pen(Color.DarkBlue, 2f);
Pen pen3 = new Pen(Color.Gainsboro);
pen3.DashStyle = DashStyle.Dash;
Brush brush2 = new SolidBrush(Color.DimGray);
int y = num13;
int num21 = 0;
for (int i = 0; i < classArray.Length; i++)
{
CharClass class3 = classArray[i];
foreach (Character character2 in this.charSet)
{
if (character2.type == class3)
{
num21++;
int num23 = num21 % num15;
if (num23 == 0)
{
num23 = num15;
}
if ((num23 == 1) && (num21 > 1))
{
y += height + num13;
}
int x = ((width * (num23 - 1)) + num13) + num16;
if (character2.type == CharClass.Signature)
{
width *= 5;
}
Rectangle rect = new Rectangle(x, y, width, height);
graphics.FillRectangle(brush, rect);
graphics.DrawRectangle(pen, rect);
int num25 = (y + num4) + num10;
graphics.DrawLine(pen2, x, num25, x + width, num25);
graphics.DrawString(character2.representation, new Font("Microsoft Sans Serif", (float)num7), brush2, (float)(x + 3), (float)y);
int num26 = num25 + num9;
graphics.DrawLine(pen2, x, num26, x + width, num26);
graphics.DrawLine(pen3, x, num25 + (num9 / 2), x + width, num25 + (num9 / 2));
Graphics g = base.CreateGraphics();
Rectangle rectangle = rect;
rectangle.Y += num4;
rectangle.Height -= num4;
character2.setPosition(rectangle, num26, num25, g, this.inkOverlay.Renderer);
if (character2.type == CharClass.Signature)
{
width /= 5;
}
}
}
if (this.breakCharTypes || ((i < (classArray.Length - 1)) && (classArray[i + 1] == CharClass.Signature)))
{
y += height + num13;
num21 = 0;
}
}
this.picBoxCharacters.Image = image;
this.picBoxCharacters.Refresh();
}
public virtual Enumerator GetEnumerator()
{

return new Enumerator(this );///iam getting error on this line An unhandled exception of type 'System.StackOverflowException' occurred ()


}
iam using INKOVERLAY(Tablet PC using CSharp) class so that i can write under all the charcaters in the drawing area, my solution build successfully , no other errors but when the form load it show the stack overflow exeception , please help me out to solve the error

waiting for possitive response
with regards
radhika
AnswerRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
Thomas Krojer16-Jun-09 22:32
MemberThomas Krojer16-Jun-09 22:32 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
Mirko198016-Jun-09 22:43
MemberMirko198016-Jun-09 22:43 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
radhikasharma16-Jun-09 23:08
Memberradhikasharma16-Jun-09 23:08 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
radhikasharma16-Jun-09 23:06
Memberradhikasharma16-Jun-09 23:06 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
Thomas Krojer16-Jun-09 23:13
MemberThomas Krojer16-Jun-09 23:13 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
radhikasharma17-Jun-09 1:21
Memberradhikasharma17-Jun-09 1:21 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
DaveyM6917-Jun-09 1:37
professionalDaveyM6917-Jun-09 1:37 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
OriginalGriff16-Jun-09 23:39
mveOriginalGriff16-Jun-09 23:39 
AnswerRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
DaveyM6916-Jun-09 23:50
professionalDaveyM6916-Jun-09 23:50 
AnswerRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
Alan N17-Jun-09 1:05
MemberAlan N17-Jun-09 1:05 
JokeRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
akyriako7817-Jun-09 4:34
Memberakyriako7817-Jun-09 4:34 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
radhikasharma17-Jun-09 4:50
Memberradhikasharma17-Jun-09 4:50 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
akyriako7817-Jun-09 4:54
Memberakyriako7817-Jun-09 4:54 
JokeReminds me of an Aggie Joke Pin
Andrew Rissing17-Jun-09 5:07
MemberAndrew Rissing17-Jun-09 5:07 
GeneralRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
radhikasharma17-Jun-09 5:35
Memberradhikasharma17-Jun-09 5:35 
AnswerRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
Lutosław17-Jun-09 9:37
MemberLutosław17-Jun-09 9:37 
AnswerRe: Help me iam getting stack overflow exeception , while my solution build successfully , but it threw the stack overflow error Pin
Jeremy Tierman18-Jun-09 6:08
MemberJeremy Tierman18-Jun-09 6:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.