Highlighted
Absent Member.
Absent Member.
1077 views

Changing Cursor Shape in Visual Cobol

Jump to solution

[Migrated content. Thread originally posted on 09 December 2011]

Hi All,

Any one know the code to change the cursor shape to an hour glass when going off and doing a large SQL job and then resetting back to an arrow when finished?

Kind regards

Neil.
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Changing Cursor Shape in Visual Cobol

Jump to solution
In a Windows Forms project you can do the following:



      $set ilusing"System.Windows.Forms"
       class-id testhourglass.Form1 is partial
                 inherits type System.Windows.Forms.Form.
       
       working-storage section.
       
       method-id NEW.
       procedure division.
           invoke self::InitializeComponent
           goback.
       end method.

       method-id button1_Click final private.
       procedure division using by value sender as object e as type System.EventArgs.

           set type Cursor::Current to type Cursors::WaitCursor
           invoke type System.Threading.Thread::Sleep(5000)
           set type Cursor::Current to type Cursors::Default

          end method.
     
       end class.

View solution in original post

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Changing Cursor Shape in Visual Cobol

Jump to solution
In a Windows Forms project you can do the following:



      $set ilusing"System.Windows.Forms"
       class-id testhourglass.Form1 is partial
                 inherits type System.Windows.Forms.Form.
       
       working-storage section.
       
       method-id NEW.
       procedure division.
           invoke self::InitializeComponent
           goback.
       end method.

       method-id button1_Click final private.
       procedure division using by value sender as object e as type System.EventArgs.

           set type Cursor::Current to type Cursors::WaitCursor
           invoke type System.Threading.Thread::Sleep(5000)
           set type Cursor::Current to type Cursors::Default

          end method.
     
       end class.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Changing Cursor Shape in Visual Cobol

Jump to solution
Hi Chris,

Again many thanks that works really well.

Out of interest can you pls advise what this line does?

$set ilusing"System.Windows.Forms"

Kind regards

Neil.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Changing Cursor Shape in Visual Cobol

Jump to solution
It brings the namespace System.Windows.Forms into the program so that the compiler will recognize its classes without having to specify the entire name.

For instance, the class named Cursor is actually in the namespace System.Windows.Forms so if you did not specify:
$set ilusing"System.Windows.Forms"

You would have to reference the Cursor and Cursors classes using the full name like:

set type System.Windows.Forms.Cursor::Current to type System.Windows.Forms.Cursors::WaitCursor

You can also set these on the Namespace tab of the Project Properties page by selecting the namespaces to include.
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.