how to put buttons in one window to drag all of them

 

hi every one

I write an expert that put 3 buttons : SELL  BUY CLOSE

I want to put these 3 buttons into a panel or window that I can drag them together

can any one help me

Best regards

Neda

 
Neda shahbazi:

hi every one

I write an expert that put 3 buttons : SELL  BUY CLOSE

I want to put these 3 buttons into a panel or window that I can drag them together

can any one help me

Best regards

Neda

ouush ! that is not easy :) but here's you go ... 

https://www.mql5.com/en/articles/4503

How to create a graphical panel of any complexity level
How to create a graphical panel of any complexity level
  • www.mql5.com
Even now most programmers, who develop indicators and Expert Advisors for the MetaTrader 5 platform, do not use the available graphical interface creation capabilities in their applications. I believe this is because Panels and Dialogs classes of the Standard Library only provide a brief technical description of methods. The language reference...
 
Icham Aidibe:

ouush ! that is not easy :) but here's you go ... 

https://www.mql5.com/en/articles/4503

your links are for MT5 I use MT4

do you  have reference for MT4?

 

hi

Thanks for reply I saw your expert that was complicated for me I really cant understand I just want to put below buttons in box that I can drag them can you guide me in easy way?

int b1()
  {
   int chart_ID=0;
   string name="BUY";
   if(!ObjectCreate(0,name,OBJ_BUTTON,0,0,0))
     {
      Print(__FUNCTION__,
            ": failed to create the button! Error code = ",GetLastError());
      return(false);
     }

   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,570);
   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,38);
   ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,60);
   ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,36); 
   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,0); 
   ObjectSetString(chart_ID,name,OBJPROP_TEXT,"BUY");
   ObjectSetString(chart_ID,name,OBJPROP_FONT,"Arial");
   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,12);
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clrWhite);
   ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,clrGreen);
   ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,clrBlack); 
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_STATE,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,0);
 
//+------------------------------------------------------------------+
//| Button   SELL                                                             |
//+------------------------------------------------------------------+ 
   string name1="SELL";
   if(!ObjectCreate(0,name1,OBJ_BUTTON,0,0,0))
     {
      Print(__FUNCTION__,
            ": failed to create the button! Error code = ",GetLastError());
      return(false);
     } 
   ObjectSetInteger(chart_ID,name1,OBJPROP_XDISTANCE,675);
   ObjectSetInteger(chart_ID,name1,OBJPROP_YDISTANCE,38);
   ObjectSetInteger(chart_ID,name1,OBJPROP_XSIZE,60);
   ObjectSetInteger(chart_ID,name1,OBJPROP_YSIZE,36);
   ObjectSetInteger(chart_ID,name1,OBJPROP_CORNER,0);
   ObjectSetString(chart_ID,name1,OBJPROP_TEXT,"SELL");
   ObjectSetString(chart_ID,name1,OBJPROP_FONT,"Arial");
   ObjectSetInteger(chart_ID,name1,OBJPROP_FONTSIZE,12);
   ObjectSetInteger(chart_ID,name1,OBJPROP_COLOR,clrWhite);
   ObjectSetInteger(chart_ID,name1,OBJPROP_BGCOLOR,clrRed);
   ObjectSetInteger(chart_ID,name1,OBJPROP_BORDER_COLOR,clrBlack);
   ObjectSetInteger(chart_ID,name1,OBJPROP_BACK,false);
   ObjectSetInteger(chart_ID,name1,OBJPROP_STATE,false);
   ObjectSetInteger(chart_ID,name1,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(chart_ID,name1,OBJPROP_SELECTED,false);
   ObjectSetInteger(chart_ID,name1,OBJPROP_HIDDEN,false);
   ObjectSetInteger(chart_ID,name1,OBJPROP_ZORDER,0);
}

 
any body cant help me?
 
Neda shahbazi:

your links are for MT5 I use MT4

do you  have reference for MT4?

In future please put your topic in the correct "MQL4 and Metatrader 4" section.

I will move the topic there.

Please edit your post and use the code button (Alt+S) when pasting code.

Reason: