Results 1 to 3 of 3

Thread: Textbox - Ctrl+Enter=NewLine Enter=Accept

  1. #1

    Thread Starter
    Hyperactive Member stingrae's Avatar
    Join Date
    Apr 2002
    Location
    Sydney
    Posts
    401

    Resolved Textbox - Ctrl+Enter=NewLine Enter=Accept

    Hi everyone,

    is there any example code out there that can help me to the following:

    inside a multiline Text Box I want it so that when a user presses Ctrl AND Enter then a new line is entered.

    But, if they press Enter on it's own, then it acts like the Accept button on the Form.

    i believe this is how Facebook does it.

    i thought it was easy, but it's not as easy as i thought ...

    thanks in advance
    Last edited by stingrae; May 10th, 2012 at 08:38 PM. Reason: Resolved
    "The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.

    Windows & Web Developer
    Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
    Sutherland Shire, Sydney Australia
    www.stingrae.com.au
    Developer of Arnold - Gym & Martial Arts Database Management System
    www.gymdatabase.com.au

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Textbox - Ctrl+Enter=NewLine Enter=Accept

    It's easy alright. Set the AcceptsEnter property of the TextBox to False. The fact that you didn't know that indicates that you haven't read the documentation for the TextBox class, which should have been the first thing you did when you wanted to do something with the TextBox class.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member stingrae's Avatar
    Join Date
    Apr 2002
    Location
    Sydney
    Posts
    401

    Re: Textbox - Ctrl+Enter=NewLine Enter=Accept

    thanks for the answer
    "The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.

    Windows & Web Developer
    Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
    Sutherland Shire, Sydney Australia
    www.stingrae.com.au
    Developer of Arnold - Gym & Martial Arts Database Management System
    www.gymdatabase.com.au

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width