Disappeared Chart

JP2019  

Hi support,
I am creating a dialog with EA using Dialog.mqh
Then when i try to use the external function "input" to change the parameters, the whole program went dis-functional.
I failed to close the APP window.
And if I tried to right click and "remove" the APP window, the chart at the background was closed at the same time.

This happens only when I right clicked and chose Expert Advisors > Properties > Clicked "OK" at the window.
(If I clicked Cancel at the Properties window, everything will be normal)

I assume the INPUT part went wrong in this case, but I am not sure.
Please advise any solution to prevent from removing the charts with the App window.

Thank you

There is the created dialog .

#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com" 
#property version   "1.00"
#include <Controls\Dialog.mqh>

CAppDialog AppWindow;

//--- input parameters
input int MAGIC=123;
//+------------------------------------------------------------------+
//| Expert initialization function                                   | 
//+------------------------------------------------------------------+
int OnInit()
  {
   if(!AppWindow.Create(0,"AppWindow",0,20,20,360,324)) 
      return(INIT_FAILED);
   AppWindow.Run();
   return(INIT_SUCCEEDED);
  } 
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 | 
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   AppWindow.Destroy(reason); 
  }
//+------------------------------------------------------------------+
//| Expert chart event function                                      | 
//+------------------------------------------------------------------+
void OnChartEvent(const int id, 
                  const long& lparam,  
                  const double& dparam,
                  const string& sparam) 
  {
   AppWindow.ChartEvent(id,lparam,dparam,sparam);
  } 
//+------------------------------------------------------------------+
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
Ask questions on technical analysis, discuss trading systems and improve your MQL5 programming skills to develop your own trading strategies. Communicate and share your experience with traders from anywhere in the world, answer questions and help beginners — MQL5.community is developing along with you. Unable to create custom symbol because...
Files: