vb.net - How to Add Click Listener to Programmatically Added Tabcontrol -
in application i'm programmatically adding tab so:
'show searchresults tab if not present if not tabcontrol1.tabpages.contains(tabsearchresults) tabcontrol1.tabpages.insert(3, tabsearchresults) end if
now cant seem manually add click event listener tab in design view, , when in codeview nothing happens when click tab.
so question is,.. how add click listener tabsearchresults tab?
i assume tabsearchresults
tabpage
.
first create function handler of click
event
private sub tabsearchresults_click(sender object, e eventargs) 'your code ... end sub
then after line initialize tabpage
add handler:
tabsearchresults = new tabpage() addhandler tabsearchresults.click, addressof tabsearchresults_click
Comments
Post a Comment