Access VBA - TreeView Control - AfterLabelEdit Event -
i've got treeview control in form. able edit node in tree , push change access db. however, i'm having trouble finding appropriate event. msdn treeview events reference page advices afterlabeledit, not able work. aware of workaround/solution? snippet of code use (i've added onclick , ondblclick comparison, work):
private sub xmytreeview_click() 'ok testit end sub private sub xmytreeview_dblclick() 'ok editlabel end sub private sub xmytreeview_afterlabeledit() 'problem afterlabel end sub sub editlabel() me.xmytreeview.startlabeledit end sub sub afterlabel() msgbox prompt, vbokonly, "afterlabel" end sub sub testit() dim nodselected mscomctllib.node ' variable selected node set nodselected = me.xmytreeview.selecteditem ' selected node nodesstrlength = len(nodselected.key) dim nodestr string dim strtochange string strtochange = nodselected.key nodestr = mid(strtochange, 2, nodesstrlength - 1) me.txtnodeid = nodestr me.sfrmdocnode.visible = true end sub
your link .net windows form treeview mscomctllib
older visual basic common controls: http://msdn.microsoft.com/en-us/library/aa443023(v=vs.60).aspx
note event prototype different; if don't declare correct arguments never raised;
private sub object_afterlabeledit(cancel integer, newstring string)