How to make a Button Movable on Chart

 

Hello i am trying to create a Button that i will be able to drag and move it in the chart.

I have written the code below but it does not seem to work. Could you tell me what more code lines i should include in order to work.?


//+------------------------------------------------------------------+
//|                                             OOP_Button_Test1.mq4 |
//|                                                  Copyright 2021, |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, "
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

#include <Controls/Button.mqh>

CButton Button1;

int OnInit()
  {

   ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,true);

   Button1.Create(0,"button1",0,100,200,200,50);

   return(INIT_SUCCEEDED);
  }
void OnDeinit(const int reason)
  {
   
  }
void OnTick()
  {
   
  }
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   
   Button1.OnEvent(id,lparam,dparam,sparam);
   
   
  }
Reason: