about calculator in c#
-
HOW i can divide the single text box text in two parts after the pressing the + button please guide me or give me the idea.
-
HOW i can divide the single text box text in two parts after the pressing the + button please guide me or give me the idea.
Define what you mean by "divide the textgbox text in two parts"... What exactly is supposed to happen?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
HOW i can divide the single text box text in two parts after the pressing the + button please guide me or give me the idea.
Horizontally or vertically. Diagonally would be difficult.
-
HOW i can divide the single text box text in two parts after the pressing the + button please guide me or give me the idea.
If you want to break the text into two parts on entry of
+
character then I think theKeyPress
event ofTextBox
can be handled to replace the+
character with\n
as shown below:TextBox textBox1 = new TextBox();
textBox1.Multiline=true;
textBox1.Height=100;
textBox1.KeyPress += (s, args) => {
if (args.KeyChar=='+')
args.KeyChar= '\n';
};
Controls.Add(textBox1);If you want to retain
+
and then break the text into next line then replaceargs.KeyChar = '\n';
withSendKeys.Send("{ENTER}");
To run the above code, create aWindows Forms application
in C#, place the above code in theForm.Load
event handler and run the application. -
HOW i can divide the single text box text in two parts after the pressing the + button please guide me or give me the idea.