<i><font color="#663300">I have just added a treeview to a iBizObjForm, frmCustomers and am able to navigate by clicking on the nodes and the Form refreshes to show the clicked details. The problem is that the iNavToolBar for the form does not refresh to the new record. Suppose I click the last record then the NavButtons do not enable disable, in fact they do not change at all. I have tried thisform.refreshform(), thisform.otoolbar.refresh() but to no avail. Please let me know how to go about this.</font></i>
The refreshing of the toolbars is done in a rather odd fashion, IMO. Forms have properties named <b>lBOF </b>and <b>lEOF</b> that are used to tell the toolbar what its state is. The code in cBizobjForm.RefreshToolbar() reads:
<code>IF TYPE("This.oToolbar.Name") == "C" * Conditions are "EOF", "BOF" or "ONERECORD" DO CASE CASE This.lEOF AND This.lBOF lcCondition = "ONERECORD" CASE This.lEOF lcCondition = "EOF" CASE This.lBOF lcCondition = "BOF" OTHERWISE lcCondition = "" ENDCASE
This.oToolbar.Refresh(lcCondition) ENDIF</code>
So what you'll have to do is set the lEOF/lBOF properties after every navigation move of the tree, and then call Thisform.RefreshToolBar().
<i><font color="#663300">Also what will I need to get treeview to have one record under a record. Right now I have a flat treeview with all the records on the same plane.</font></i>
Right click on the control, and select Help. Look at the Add method. It has instructions for adding sibling and child nodes.
<i><font color="#663300">I noticed one more thing. When the focus is on the TreeView the Ctrl+PgUp/Dn, etc. key dont work. Shift the focus onto the Fields and the Ctrl+Keys start working.</font></i>
That's because an ActiveX control is essentially its own environment. When it has focus, VFP behaviors don't really apply.
<font color="#cc0000"> ___/ / __/ / ____/</font> Ed Leafe ©2002 Ed Leafe |