fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Ultra stupid question

Ultra stupid question 6 months 4 days ago #8359

  Jorge Contreras's Avatar Topic Author Jorge Contreras Offline Posts: 15
In VS 2017, how does one call another "form.prg" ??

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 4 days ago #8360

  Chris Pyrgas's Avatar Chris Pyrgas Offline Posts: 1402
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!
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 4 days ago #8361

  Jorge Contreras's Avatar Topic Author Jorge Contreras Offline Posts: 15
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

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 4 days ago #8362

  Johan Nel's Avatar Johan Nel Away Posts: 568
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:
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
George, South Africa

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 4 days ago #8366

  Jorge Contreras's Avatar Topic Author Jorge Contreras Offline Posts: 15
I used the following and it worked:

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

Thanks

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 4 days ago #8368

  Karl Faller's Avatar Karl Faller Offline Posts: 712

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

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 4 days ago #8370

  Jorge Contreras's Avatar Topic Author Jorge Contreras Offline Posts: 15
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.

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 3 days ago #8373

  Johan Nel's Avatar Johan Nel Away Posts: 568

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
George, South Africa

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 1 day ago #8433

  Jorge Contreras's Avatar Topic Author Jorge Contreras Offline Posts: 15
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.

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 23 hours ago #8434

  Johan Nel's Avatar Johan Nel Away Posts: 568
Well I am interested in seeing what we can do with your code in XSharp...
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 18 hours ago #8435

  Terry Bourne's Avatar Terry Bourne Offline Posts: 133
Hi

I well understand your concerns in respect of investing time and effort into learning and understanding a new (to you) product.

XSharp will, I am sure, gain traction. Based as it is on the earlier syntax of VO (which may lead some to think of it as old-hat rather than new), and backed by a committed/ responsive development team and growing community, all evidence points towards this being the case.

In addition to that, anything you learn has simple read-across to MS's flagship product C#, with the advantage that you'll probably find it much easier. (That latter point is, of course subjective)

Focus on getting to grips with WPF. Focus on the concepts of Class wide functions (essential for WPF) and I'll guarantee your time will not be wasted.

Terry

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 13 hours ago #8436

  Jorge Contreras's Avatar Topic Author Jorge Contreras Offline Posts: 15
lumberjack, hopefully I'll get to actual code examples. Right now it's the bare basics.

Terry, I agree with all your points. As for XSharp and .NET, I'm using Winforms and plan to keep it this way for a while. I've only tinkered with WPF.

Please Log in or Create an account to join the conversation.

Ultra stupid question 6 months 12 hours ago #8439

  Wolfgang Riedmann's Avatar Wolfgang Riedmann Offline Posts: 1789
Hi,

if you need some samples of small X# application, and are using XIDE, you can find a few here:
riedmann.it/verschiedenes_xsharp.php
And in XIDE, on the samples tab of the new application dialog, there are a few more.

I have to add some more applications, I know.... I will try to something in the next weeks.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

  • Page:
  • 1