C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Pls help me(Replace Enter Key) Posted by prasanthie on 21 Sept 2002 at 1:31 AM
Couls someone pls help me i this
I need to replace the enter key with "<br>"
We used to do this in asp as
replace(char(13),"<br>)
How do i do this in C#


Report
Re: Pls help me(Replace Enter Key) Posted by JCrouch on 25 Sept 2002 at 9:32 PM
: Couls someone pls help me i this
: I need to replace the enter key with ""
: We used to do this in asp as
: replace(char(13),")
: How do i do this in C#
:
:
:
:Here is a way for a multiline textbox:

private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if(e.KeyChar == (char)13)
{
TextBox myBox = new TextBox();
myBox = (TextBox)sender;
myBox.AppendText("<br>");
e.Handled = true;
}
}

You should be able to adapt it for other controls as well :)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.