Pls help me(Replace Enter Key) - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Pls help me(Replace Enter Key)

prasanthieprasanthie Posts: 1Member
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#


Comments

  • JCrouchJCrouch Posts: 9Member
    : 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("
    ");
    e.Handled = true;
    }
    }

    You should be able to adapt it for other controls as well :)
Sign In or Register to comment.