programming x button to close


hello want know how can programming x button message box confirm close

hi dereklouis,

are trying messagebox confirm exit winform? if please write below code form's formclosing event. hope helps you.

private void form1_formclosing(object sender, formclosingeventargs e) {     if (messagebox.show("exit or no?",                 "confirm exit",                 messageboxbuttons.yesno,                 messageboxicon.information) == dialogresult.no)     {         e.cancel = true;     } }

thanks,

sabah shariq


please remember mark replies answers if help. if post helpful please vote



Learning  >  Small Basic



Comments

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607