Enter Key

Posted on 2005-04-19
Last Modified: 2013-12-26
Hi All,

I need to provide enter key facility within the multi line edit control to go to the next line.
Currently i have to press CTRL + Enter key to go to the next line.

Is this possible? (only enter key to go to next line)

Thanks in advance
Question by:srinib

    Expert Comment

    In your MultiLine Datawindow. Just maintain 2 Instance Variables for is_FirstCol, is_LastCol.
    Assign the Column Names in the Open Event of the Window.

    Create User Event called ue_enter using the "pbm_dwnprocessenter"

    The Following Script will take to Next Column, just like Tab.

    Send(Handle(this), 256, Long(9, 0), Long(0, 0))
    RETURN 1

    Long      ll_row
    IF This.GetColumnName( ) = is_LastCol THEN
          // When User is in the Last Row of the Datawindow, This will Trigger the AddRow Event of the DataWindow
          IF This.GetRow( )      = This.RowCount( ) THEN
            ll_row = This.Event AddRow()
            This.ScrollToRow( ll_row )
            This.SetColumn( is_FirstCol )
            This.Object.DataWindow.HorizontalScrollPosition = 0
         ELSE //Otherwise, it will take to next row
            This.ScrollToRow( This.GetRow() + 1 )
            This.SetColumn( is_FirstCol )
            This.Object.DataWindow.HorizontalScrollPosition = 0
        END IF
    ELSE // If the Column is not the Last One, it will take to Next Column
          Send(Handle(this), 256, Long(9, 0), Long(0, 0))
    END IF
    RETURN 1
    LVL 1

    Author Comment

    I am Sorry kumaraykkara, my requirement is not to provide enter key functionality between DW columns.

    My requirement is that, i have a multi line edit control in a window. When entering some text in that control, currently i need to press CTRL+Enter key to go to the next line. But i want to have only enter key to go to next line within multi line edit control.

    Hope you understood my case.

    LVL 1

    Accepted Solution

    You need to set the IgnoreDefaultButton property of the MLE to True. When set to True a new line will be added to the MLE when the Enter key is pressed.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now