Ultra stupid question

This forum is meant for questions and discussions about the X# language and tools
Anonymous

Ultra stupid question

Post by Anonymous »

In VS 2017, how does one call another "form.prg" ??
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Ultra stupid question

Post by Chris »

What do you mean, how to display another form? If you have created another, say Form2, then you need

LOCAL oForm AS Form2
oForm := Form2{}
oForm:Show()

If you are just asking how to create another form, then you need to use Project->Add New Item and from the list pick "Windows.Forms.Form".

If you are asking something different, please explain!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
fxsharp

Ultra stupid question

Post by fxsharp »

I want to run/call the form program. In VFP you execute: do form1.prg or do form form1. I don't have any Clipper/VO experience.

The form was created via -> right click on project -> Add -> New Item -> Windows Forms/Windows Forms Forms
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Ultra stupid question

Post by lumberjack »

Hi,
fxsharp wrote:I want to run/call the form program. In VFP you execute: do form1.prg or do form form1. I don't have any Clipper/VO experience.
The form was created via -> right click on project -> Add -> New Item -> Windows Forms/Windows Forms Forms
Here is the basics of an application that creates a MainForm via the designer and run it:

Code: Select all

USING System.Windows.Forms
USING System.Drawing

[STAThreadAttribute];
FUNCTION Start( asCmdLine AS STRING[] ) AS INT
	LOCAL nExitCode AS INT
	nExitCode := 0
	Application.EnableVisualStyles()
	Application.Run(FormMain{})
RETURN nExitCode
______________________
Johan Nel
Boshof, South Africa
fxsharp

Ultra stupid question

Post by fxsharp »

I used the following and it worked:

LOCAL oForm AS Form2
oForm := Form2{}
oForm:Show()

Thanks
FFF
Posts: 1580
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Ultra stupid question

Post by FFF »

fxsharp wrote:I used the following and it worked:

LOCAL oForm AS Form2
oForm := Form2{}
oForm:Show()
You see, why we loved VO?
LOCAL oForm AS Form2 // you have a cookie cutter, defined somewhere in your app
oForm := Form2{} // you make "a" cookie
oForm:Show() // you say: show yourself, that i might eat you ;)

Easier and clearer, imho, it can't get.

Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
fxsharp

Ultra stupid question

Post by fxsharp »

VFP also has class based forms. Thought there might be an old school way of launching programs. And I don't know squat about .NET, to make matters worse.
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Ultra stupid question

Post by lumberjack »

fxsharp wrote:VFP also has class based forms. Thought there might be an old school way of launching programs. And I don't know squat about .NET, to make matters worse.
Don't worry about not knowing .NET

Just ask and we will assist. Even better, just post a VFP example and we will show you how to achieve the same effect in X#. It will get easier as more of the VFP syntax is supported in X#.

XBase greets,
______________________
Johan Nel
Boshof, South Africa
fxsharp

Ultra stupid question

Post by fxsharp »

Thanks lumberjack. I did not use VFP much to be honest. Mostly FPD. I spent a lot of time understanding OOP in VFP and wrote a few small apps but never made the leap because I thought in the back of my head Microsoft was going to abandon the product. Sure enough they did. In between I'd mess around with clipper and then harbour, but never saw a future in it. If xSharp gains traction, then I'll be sold. I'm actually not really interested in xSharp/VFP.
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Ultra stupid question

Post by lumberjack »

Well I am interested in seeing what we can do with your code in XSharp...
______________________
Johan Nel
Boshof, South Africa
Post Reply