Author Topic: How to create an Event after hit the ENTER KEY in the RecipeSaveButton  (Read 2755 times)

xulan

  • Newbie
  • *
  • Posts: 3
    • View Profile
I am using the RecipeSaveButton to save one recipe, if i press the RecipeSaveButton, the keypad will be popup, then I can set the name of the recipe and hit "Enter" key to save it.

Is it possible to create one flag which I can use for another form.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: How to create an Event after hit the ENTER KEY in the RecipeSaveButton
« Reply #1 on: February 19, 2019, 08:04:35 AM »
Can you explain what you mean by "one flag"?

xulan

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to create an Event after hit the ENTER KEY in the RecipeSaveButton
« Reply #2 on: February 20, 2019, 01:20:50 AM »
The flag could be bool value which could be readable in another form, I want to know the setting is done.

But this "Enter" button belongs to the popup keypad, I just want to use this event to trigger a bit in another form.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: How to create an Event after hit the ENTER KEY in the RecipeSaveButton
« Reply #3 on: February 20, 2019, 02:51:01 PM »
Attached is a modified RecipeSaveButton that has a RecipeSaved event

- Download the attached file
- Open your solution in Visual Studio
- In Solution Explorer, expand down AdvancedHMIControls project
- Right click the RecipeControls folder and select Add->Existing
- Browse to the file downloaded
- Rebuild solution

Your RecipeSaveButton will now fire the RecipeSaved event

Rizwan

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: How to create an Event after hit the ENTER KEY in the RecipeSaveButton
« Reply #4 on: February 24, 2019, 09:56:52 PM »
I have tried it but same as before ,

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: How to create an Event after hit the ENTER KEY in the RecipeSaveButton
« Reply #5 on: February 24, 2019, 10:10:01 PM »
I just tried it out with a MsgBox in the event handler and it worked for me by popping up the box when I saved a recipe

Code: [Select]
    Private Sub RecipeSaveButton1_RecipeSaved(sender As Object, e As EventArgs) Handles RecipeSaveButton1.RecipeSaved
        MsgBox("Recipe Saved!")
    End Sub
« Last Edit: February 24, 2019, 10:14:18 PM by Archie »

Rizwan

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: How to create an Event after hit the ENTER KEY in the RecipeSaveButton
« Reply #6 on: February 24, 2019, 10:11:43 PM »
Thanks ... :)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: How to create an Event after hit the ENTER KEY in the RecipeSaveButton
« Reply #7 on: February 24, 2019, 10:19:30 PM »
Did you make the modification or try it from the latest beta version? I noticed it actually wasn't in 2.99y beta 24

Rizwan

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: How to create an Event after hit the ENTER KEY in the RecipeSaveButton
« Reply #8 on: February 24, 2019, 10:31:00 PM »
Yes we are working in beta version 3.99
...
Dear , do you have Recipe Delete or rename solution ?
and
while we saved recipe with same name, can we popup message box to ask before  overwrite ?
« Last Edit: February 24, 2019, 11:08:00 PM by Rizwan »