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!

Activation of Form in Visual Fox Pro 2

Status
Not open for further replies.
Sep 26, 2020
11
IN
Hi
I am a new comer to Visual Fox Pro and not a professional SW designer. I am designing a SW based on VFP 9.0 for my personal use. I have designed some forms, reports etc NOT USING Project in VFP. My problem is every time I have to load VFP 1st. Then type DO FORM LOGIN in command window. 3rd manually close the command window and properties window.
I want to make an Icon on desktop to directly open my Software without going to VFP command window.
Please held me in this regard.
 
Hi,

You might want to get acquainted with the PROJECT MANAGER to manage your main program, forms, reports, menus ... then build an APP or an EXE and run this APP/EXE from the Windows Dektop.

@Koen

Btw I assume SW = SoftWare

hth

marK
 
Hi Friends,
I think, I could not express my problem.
As you know, I am not a professional software programmer. I am a new comer to the world of visual fox pro 9.0. I have designed some forms and reports using visual foxpro 9.0 through Command Window like MODI FORM login, MODI REPO abc etc. but not through CREATE PROJECT. My problem is, every time, when I want to work through this, (1)-I have to load the visual foxpro, (2)- Have to type in Command Window : DO FORM LOGIN, (3)-after login, manually I have to close Command Window and Properties Windows. Every thing is running fine. But I want to make an ICON on my Desktop, to which, I have to click that ICON and get the LOGIN SCREEN without moving through the said 3 steps. It would be easier to anybody to run the application.
So please help me in this regard.

Thank you
 
Hi Sanjib,

You have expressed your problem perfectly. And there is a solution. But unfortunately it might take a lot more than a forum post to explain it.

Let's start by taking the simplest case. Let's suppose you only have one "main" form in your system. That form might invoke other forms, but let's leave that to one side for the moment. Essentially, what you need to do is to create an executable program (an EXE file) that you can run straight from the Windows desktop. The program will load the form, wait while you interact with it, and then when you are ready to close the form, the program will terminate.

The first thing you need to do is to create a program (a PRG file) that will invoke the form. The program issues a DO FORM command (look it up in the Help) and then a READ EVENTS command.

In your form, you need a way to tell the system that you want to quit. Let's say you have a Quit button in that form. In the Click event of the button, execute CLEAR EVENTS.

OK, you now have the components in place. The next step is to tie them together. To do that, create a project (with MODIFY PROJECT). Add your PRG and your form to the project. (Again ,refer to the Help for details.) The PRG will appear in the Code tab. Right click on it and make sure that Set Main is ticked.

Next, you will build the executable. In the project manager, click the Build button, and select "Win 32 Executable / COM Server", then click OK. You will be prompted for a filename for your executable. Once you have entered that, VFP will create the executable program (the EXE file).

You can now run the executable directly from Windows by double-clicking on it. And you can create a desktop shortcut for it in the usual way.

The above explanation is very much a simplification. There are other details that you will need to address. But I hope this will at least give you a flavour of how to go about it.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Dear Friends,
As U know I am a newcomer to VFP 9.0.
I am facing a problem to make a textbox to change interactively like MS-XLS(This formula is in F1 Cell =SUM(A1:E1). Whenever the value is changed in A1 through E1 immediately the value of F1 is changed. I want this type of change in VFP Form.
I have textboxes like Text1, Text2....Text6. The Text6 is the SUM of Text1 through Text5 and I have put the line
Thisform.Text6.value=VAL(thisform.Text1.text)+VAL(thisform.Text2.text)+VAL(thisform.Text3.text)+VAL(thisform.Text4.text)+VAL(thisform.Text5.text) in Valid Method of each of the Textbox Text1 through Text5.

And please let me help that, How to store the Photo/Image file in .DBF and also to retrieve from .DBF & display on a form while searching to a particular ID.

Please suggest in this regard.

Thank You.
 
Sanjib, you should put those two questions into topics of their own.
 
Sanjib,

ad your first question

First I would put the code in the LostFocus event of each Textbox

Second :
If the underlying fields are NUMERIC (type "N", "I", "Y") you'd have some thing like below

Code:
ThisForm.Text6.Value = ThisForm.Text1.Value + ThisForm.text2.Value ...

If the underlying fields are of CHARACTER type (which you might want to review then) you'd have some thing like below

Code:
ThisForm.Text6.Value = VAL(ThisForm.Text1.Value) + VAL(ThisForm.text2.Value) ...

If you have no underlying fields, please have a look at the help file : Visual FoxPro 9.0 SP2 Value Property


ad 2nd question

Please have a look et the Help File : Visual FoxPro 9.0 SP2 Picture Property (Visual FoxPro)

hth

marK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top