Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Releasing Multiple forms ?

Status
Not open for further replies.
Apr 12, 2002
31
US
Hi,
I have a main form as toplevel that calls my "treeview" form from the activate event, so that is is loaded when the program is first run. The treeview form has a treeview control on the left side and client info on the right side. I use the treeview as navigation to open other forms that are related to that client. In a click event I am wanting to close all the forms that are not the treeview or main form. As of now I have the following code:
LOCAL lncounter
lncounter = 1
DO WHILE lncounter <= _Screen.FormCount
llFormName = _SCREEN.Forms[lncounter].Name
lncounter= lncounter+ 1
IF llFormName != &quot;clienttree&quot; OR llFormname != &quot;main&quot;
RELEASE WINDOWS (llFormName)
ENDIF
ENDDO
This works, but it is also closing the treeview form, which is then reloaded ( I think by the activate event) and the record pointer on client info goes back to the top.

Please Help John

[pc] Everything I needed to know I learned from Yoda.
 
hoosier121

Try the following :-

FOR i = _SCREEN.FormCount TO 1 STEP -1
[tab]IF UPPE(ALLT(_SCREEN.Forms(i).Name)) # [CLIENTTREE];
[tab][tab][tab]OR UPPE(ALLT(_SCREEN.Forms(i).Name)) # [MAIN]
[tab][tab]RELEASE WINDOWS (_SCREEN.Forms(i).Name)
[tab]ENDIF
ENDFOR
FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
ChrisRChamberlain

Thanks for the input, but I still get the same symptom. One thing though, when i run the clienttree form by itself (i.e. not called from main.scx activate event), everything works as it should. I am wondering if the treeview needs to be in the main (toplevel) form. I think I will move it there unless anyone has any other suggestions.

Thanks John

[pc] Everything I needed to know I learned from Yoda.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top