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 followsutTile.Control = UserControl'Adding UltraTile to WinTilePanelMe.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 IButtonControlThen 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.ThanksImran
Thanks Dimitar, It works for me.
What I was doing wrong was not setting User Control Property in my container form.
Me.AcceptButton = UserControl11.AcceptButton
After setting this, it working fine for me.
Thanks for your help.
Imran
Thank you for verifying my answer.
Please do not hesitate to contact us if you have any further questions.
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:
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.