Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.