Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 618823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:35:19+00:00 2026-05-13T18:35:19+00:00

We have a multi-line control that we are attempting to prevent the Enter/Return key

  • 0

We have a multi-line control that we are attempting to prevent the Enter/Return key from being used to create a new line.

Strangely enough, “AcceptsReturn” as False does not prevent this.

So we added the following:

Private Sub txtAddr_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtAddr.KeyPress
    If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
        e.Handled = True
    End If
End Sub

This works fine, however one of the QA people discovered hitting Control + Enter still puts in a newline.

How would we prevent this?

And why does AcceptsReturn being False not work as it appears it should? What is the intended purpose of it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:35:20+00:00Added an answer on May 13, 2026 at 6:35 pm

    Ctrl + enter is most likely to produce a line feed (ASCII 10).

    It may depend on the specific system though.

    If you are checking for carriage return (ASCII 13) and line feed though you probably have most bases covered.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-line text view that can get quite large. When the user
/* Suppose I have a multi-line comment with hard line-breaks * that are roughly
I have a SQL*Loader control file that has a line something like this: FIELDS
I have some Perl code that translates new-lines and line-feeds to a normalized form.
Is it possible to create a multi-line label with word wrap that resizes in
I have: Textbox(Multi-line) Panel Different controls inside panel (buttons,textbox) Scenario: I need to add
Is it possible to have a multi-line textbox (im using asp.net c#) where the
I have a dynamic multi line UILabel and need to know the end of
I received some multi-line data via HTTP and have it in one string. I
I have a service request form. A series of textboxes (single and multi line),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.