vb.net - Override button click event from another form -
is there way override forms button click event parent form?
for example, here's kind of have going on...
dim newform new formb newform.someproperty1 = true newform.someprpoerty2 = false newform.show(me) i need know button clicked when newform closed. utilize 'showdialog', can't since newform needs open different form can't open dialog... long story short, without finish rewrite of our entire software, can't utilize showdialog.
anyways, there anyway can add together button click events form? like...
dim newform new formb newform.btn1.click = somenewfunctionorsubroutine() newform.btn2.click = someotherfunctionorsub() newform.show(me) i've been looking @ events , eventhandlers, aren't making much sense...
any tips?
you phone call addhandler on button in formb (provided modifier property public)
' code within parent form addhandler newform.btn1.click, addressof me.someotherfunctionorsub ' code within parent form protected sub someotherfunctionorsub(sender object, e eventargs) ...... end sub adding handler mutual practice intercept actions on different form (for example, need intercept form.closing event in case want have 1 instance of newform open @ time.) other approach (more complex) subscribing custom event , requires cooperation of formb code. in scenario doesn't seem necessary.
vb.net onclick subroutine
No comments:
Post a Comment