Then, in the focusout event of the textbox that confirms the new password, check whether the new password entered twice is the same. If it is different, there will be a hint. It is also possible to use messagebox and set a label to control the display and hiding.
Finally, get the new password and the old password in the click event of the confirmation button, and update the database when the old password meets the conditions.