Ismael Oliveira

Ismael Oliveira

  • 1.6k
  • 122
  • 9.4k

Function in User control

Jul 28 2020 9:55 AM
I created a UserControl with 5 buttons: New, Edit, Delete, Save, Cancel. All buttons have functions associated to them, programable by the user. Normally the 3 first buttons are enabled and the 2 other are disabled. When the user clicks on New or Edit, the 3 first buttons become disabled and the 2 others, enabeld. When the user clicks on Save, or Cancel, it returns to the original state. It's working fine, but there is an issue.
In an application, when the user clicks on the Save button, the program must first verify if the fields are all filled. If yes, OK. But if not, the function shoul do nothing. So, what I need is a way of, in the main program, test the fields and pas this information to the control. But I don't know how. I tried to create a funtion in the control type virtual and in the main program I tried to create the same function with override, but it didn't work. Can anyone help me?
Thanks.
Ismael

Answers (1)