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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to hide the Command Window on design time

Status
Not open for further replies.

TheBlainer

Programmer
Aug 31, 2011
37
CA
Hi,
I'm working on Visual FoxPro for several months and I'm tired to always close the Command Window when I open FoxPro to edit my project or a form or anything else except when editing dbf.
I found the command "HIDE COMMAND WINDOW", but I have no idea here to put it.
I know the config.fpw, but I don't know what to write in it.
Can someone help me to hide or close the Command Window when I open Foxpro please?
Thanks.
 
But by default if I open a form or my project, it's the Command Window that show first on the screen and not the Properties Window.

Yes, that's true. Even if you activate the properties tab, then exit out of VFP, it won't remember that setting. It will always start with the command window.

You can execute ACTIVATE WINDOW Properties to bring the Properties tab to the front. The problem is that there is no obvious place to execute that command. I would have said to add it to your startup program or config.fpw, but you have already said that putting HIDE WINDOW Command in the startup or config.fpw doesn't work, so I suppose it would be the same story again.

One possibility would be to put it in the Init of the project hook. That way, it will execute whenever you open the project - which I think is what you want.

Come to think of it, maybe you can put HIDE WINDOW Command in the project hook's Init. Then might achieve your original goal of hiding the command window. I'm not sure if this would work. You would need to experiment.

If you're not sure how to use a project hook, read the Help topic "Project Manager Hooks".

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike, put ACTIVATE WINDOW Properties on a startup prg is working, but the Command Window show itself after and it changes nothing.

Another thing, I realize that the code HIDE WINDOW "Command" only work when starting the .app. When I'm executing it on startup, in the command window or by running an application in a project, the Command Window has never disappeared.

Still, I can tell you that I like having the Command Window "fused" with my Properties Window. So I can keep working that way even if the Properties isn't the first one to show.

So thanks Mike for your effort!

TheBlainer
 
Another thing, I realize that the code HIDE WINDOW "Command" only work when starting the .app. When I'm executing it on startup, in the command window or by running an application in a project, the Command Window has never disappeared.

Hold the phone here. "Starting the .app" is a different condition.

If you see the command window when you run a .app then you're not running the app. It's missing a wait state (READ EVENTS) and once you build an EXE your EXE will start and immediately exit.
 
Hi,
TheBlainer said:
Well Tamar, my work is to maintain an old FoxPro application. Most of the time, I will edit forms in a project and test the application. So I don't need the Command Window to do this. Also, each time I run my application and close it, it's closing my project, because it does a clear and quit. So, I have to open the project often and have to close the Command Window several times a day.

Well I believe you are not using the IDE of VFP in a correct way. In case you have to do work as described, it is very handy to write your new/revised statement in your command window and have the result print out on your desktop. In case something wrong you can correct and only when everything is satisfactory you copy to your form and implent. This way you may avoid numerous opening and closing of your app.

The Command Window is one of most powerfull tools in VFP.

And as far as
each time I run my application and close it, it's closing my project, because it does a clear and quit.
find the method which is closing the app and put a
Code:
If Version(2) # 0
** we are in development
return .f.
else
** do your close all etc
endif
around it.

Regards,

Jockey(2)



Jockey(2)
 
Hi Jockey2,
Indeed, I could use the Command Window more to test some of my codes and not having to run my application every time.
To test my application, I have already changed the "close and clear" for a thisform.release. But I have another application to maintain and if I do that, for some reason, bugs are happening. This other application is very old and not well structured, so I keep the closing this way.

TheBlainer
 
There is yet another possible location to run code: The Environment Manager of the Task Pane.

You can associate an Environemnt with any project. Part of it is a script running before and after the environment is set.

Bye, Olaf.
 
Indeed Olaf it's working if I create a new environment set with the script HIDE WINDOW "Command" and associate my project.
Buuut, I have to open my project by clicking on it in the environment manager to execute my script. It doesn't work just by clicking on the project in the Windows Explorer and open FoxPro.

To make this work, I need to open FoxPro and the Task Pane, click on my project in the Environment manager and close the Environment Manager.

It is longer do that than just closing the Command Window manually OR clicking on the Properties Tab when I fuse the Command Window with the Properties Window (what is I prefer)

But thanks Olaf for the information, I didn't know that

TheBlainer
 
Hm, I wonder if you can't set a default environment or let it autoopen together with a project.

Bye, Olaf.
 
I don't know if we can do that and I don't really see in FoxPro the option to do it.

I think I will stop the research, because having the Command Window fused with Properties Window is very less annoying than the way it was before (for me I say, it's not the same case for everyone) and if I want it to test some code, well it's still there.



TheBlainer
 
TheBlainer, I'm sure you're making the right decision. I have been using the "fused" window for several years, and I don't even think about it.

In my cases, I have four windows "fused" together: command, properties, data sessions and document view. I'm constantly switching between them, so it doesn't really matter which one was on top first.

In fact, before you mentioned it, I hadn't even realised that VFP defaults to showing the command window on top. I'm sure that, after a few more days, you will have forgotten it was an issue.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Just a quick comment: I discovered the 'fusing' of the four windows some years ago by accident, and wouldn't do without it now. Also,if I happen to have the Properties window say on top at the time I build the application, it automatically switches to the Command window once the build is complete - so I can just type "do newapp" or whatever straight away. Over the years I must have saved good few minutes of my life not having to click on and select the Command window first.

Oddly enough, it once went through a period for several months where it didn't behave that way, then it went back to working again but I never could be bothered to investigate what I had done to change it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top