Skip to main content

Get Windows Form location

  • June 15, 2019
  • 2 replies
  • 0 views

Alexander Castro

I am trying obtain the location for the coordinates of my windows form in the program so that I may pass these coordinates to the next form. I want to be able to show a form in the same position as my previous form.  Doing this in C# is something like public System.Drawing.Point Location { get; set; }. But I simply do not know that the commands are in Visual Cobol. Thanks in advance for your help.

2 replies

Chris Glazier
Forum|alt.badge.img+2

I am trying obtain the location for the coordinates of my windows form in the program so that I may pass these coordinates to the next form. I want to be able to show a form in the same position as my previous form.  Doing this in C# is something like public System.Drawing.Point Location { get; set; }. But I simply do not know that the commands are in Visual Cobol. Thanks in advance for your help.

You would do it the same way in COBOL like you would in C# as they both use the same .NET Framework classes.

 

Something like:

declare mypoints = self::Location declare newform = new type Form2 set newform::Location to mypoints set newform::StartPosition to type FormStartPosition::Manual invoke newform::ShowDialog

Alexander Castro
  • Author
  • Participating Frequently
  • June 20, 2019

You would do it the same way in COBOL like you would in C# as they both use the same .NET Framework classes.

 

Something like:

declare mypoints = self::Location declare newform = new type Form2 set newform::Location to mypoints set newform::StartPosition to type FormStartPosition::Manual invoke newform::ShowDialog
This worked so thank you! Sorry for the late response as I been having trouble logging into this site ever since Micro Focus change their site portals.