Skip to main content
Dominique Sacre
Rocketeer
Apr 28, 2020 10:15 PM UTC

Translate C# to Visual Cobol -

Hello,

Can someone help me and translate these C# instructions to Cobol?

 

public Form1()
{
     InitializeComponent();
     this.FormBorderStyle = FormBorderStyle.None; 
     this.DoubleBuffered = true;
     this.SetStyle(ControlStyles.ResizeRedraw, true);
}

Rectangle Top1 {
     get {
          return new Rectangle(0, 0, this.ClientSize.Width, 10);
     }
}

protected override void WndProc(ref Message messages)
{
     base.WndProc(ref messages);

     if (messages.Msg == 0x84) // WM_NCHITTEST
     {
          var cursor12 = this.PointToClient(Cursor.Position);
          if (Top1.Contains(cursor12)) {
               messages.Result = (IntPtr)12;
          }
     }
}

Thanks,

Luiz Furlanetto.

    1 reply

    Dominique Sacre
    Rocketeer
    Apr 29, 2020 1:12 PM UTC

    Hello,

    Can someone help me and translate these C# instructions to Cobol?

     

    public Form1()
    {
         InitializeComponent();
         this.FormBorderStyle = FormBorderStyle.None; 
         this.DoubleBuffered = true;
         this.SetStyle(ControlStyles.ResizeRedraw, true);
    }

    Rectangle Top1 {
         get {
              return new Rectangle(0, 0, this.ClientSize.Width, 10);
         }
    }

    protected override void WndProc(ref Message messages)
    {
         base.WndProc(ref messages);

         if (messages.Msg == 0x84) // WM_NCHITTEST
         {
              var cursor12 = this.PointToClient(Cursor.Position);
              if (Top1.Contains(cursor12)) {
                   messages.Result = (IntPtr)12;
              }
         }
    }

    Thanks,

    Luiz Furlanetto.

    method-id Form1 final. procedure division. invoke InitializeComponent() set self::FormBorderStyle to type FormBorderStyle::None set self::DoubleBuffered to true invoke self::SetStyle(type ControlStyles::ResizeRedraw, true) end method. property-id Top1 type Rectangle private. getter. set property-value to new Rectangle(0, 0, self::ClientSize::Width, 10) end property. method-id WndProc override protected. procedure division using by reference #messages as type Message. invoke super::WndProc(reference #messages) if #messages::Msg = h"84" *> WM_NCHITTEST declare cursor12 = self::PointToClient(type Cursor::Position) if Top1::Contains(cursor12) set #messages::Result to 12 as type IntPtr end-if end-if end method.