Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
545
Button Clink on Hitting Enter Key
posted

Hello,

What I want:

I have one user control with couple of Text box controls and one Command button. I want that when user hit enter key then command button should be clicked.

How I am using this user control:

I have WinTilePanel and I am placing UltraTiles with code as follows

utTile = New UltraTile()
utTile.Name = "Name"
utTile.Caption = "Caption"

'Assigning User Control to UltraTile as follows

utTile.Control = UserControl

'Adding UltraTile to WinTilePanel

Me.utpWinTilePanel.Tiles.Add(utTile)

What I did for Button click:

User Control does not have AcceptButton Property like Windows Form does have it. So I declared property as follows.

Public Property AcceptButton As IButtonControl

Then I initialize with Command button

Me.AcceptButton = Me.btnCommand
What I happening:

After running Application when I hit enter, command button is not getting clicked.


Please let me know if I missing registering event or anything else.

Thanks
Imran                 

Parents
No Data
Reply
  • 23930
    Verified Answer
    Offline posted

    Hello Imran,

     

    I used Infragistics Volume 13.1 service release 2060 with Visual Studio 2012. I defined the property AcceptButton of the UserControl on the following way:

        Public Property AcceptButton As IButtonControl

            Get

                Return UltraButton1

            End Get

            Set(value As IButtonControl)

                UltraButton1 = value

           End Set

        End Property

     

    After that I set the Form’s accept button property to:

    Me.AcceptButton = UserControl11.AcceptButton

     

    Everything works properly on my machine, please run the attached sample and press “Enter” key.

    Please let me know if you have any further questions or if I am missing something.

    WFormsWithUserControlAcceptButton.zip
Children