vb.net - do some action before displaying the message box, winforms -


i use
me.cursor = cursors.waitcursor
for time taking functions hitting db.

now if exception occurs, i'll display error message as:
msgbox(ex.message)

so before displaying message, need reset cursor default. there simple way @ in 1 place instead of writing in catch blocks.

is there way inherit messagebox class , override functions?

other wise need code in catch blocks or handle exceptions @ 1 place don't want modify whole application now.

thanks in advance.

i think can create common function this, accepts exception parameter , call function in every catch block.

try 'do code here catch ex exception showexception(ex) end try   private sub showexception(ex exception) messagebox.show("an exception occured." + vbcrlf + ex.tostring()) me.cursor = cursors.default end sub 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -