Alex_Castro Trusted Contributor.
Trusted Contributor.
230 views

Get Windows Form location

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.

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Get Windows Form location

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
0 Likes
Alex_Castro Trusted Contributor.
Trusted Contributor.

Re: Get Windows Form location

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.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.