- How do I center vertical text?
- Force ENDEDIT for an "OBJ_EDIT"
- Edit box on chart
void OnTick() { //Create_TradingPanel(X_Panel, Y_Panel); }
//font_name = "Segoe UI Semilight"; //font_size = 10;
DrawEdit(unique_lbl_01 + "edit", DoubleToString(P_lot_editbox, lot_decimal_count), x + 150, y + 17, 100, 25, "\n");
ObjectSetInteger(0, name, OBJPROP_ALIGN, ALIGN_CENTER);
void OnDeinit(const int reason) { //ObjectsDeleteAll(0, short_lbl); ObjectDelete(0, unique_lbl_01 + "bg_box"); ObjectDelete(0, unique_lbl_01 + "edit"); }
These did not and cannot solve the problem.
void OnTick() { //Create_TradingPanel(X_Panel, Y_Panel); }
Disabling the panel in the OnTick() does not change anything. It still flickers and by the way I need the panel to be created in the OnTick() for future development.
DrawEdit(unique_lbl_01 + "edit", DoubleToString(P_lot_editbox, lot_decimal_count), x + 150, y + 17, 100, 25, "\n");
ObjectSetInteger(0, name, OBJPROP_ALIGN, ALIGN_CENTER);
No, this changes horizontal alignment, I want the horizontal alignment to be on the right, I want vertical alignment during the editing, before "end edit". When you click in the edit box and the value is made blue and it goes higher. I want it to be in the center vertically not horizontally, also I really liked your idea about reducing the height of the edit, but I don't want to reduce the height of Edit Box, I want to make it center during editing as it is.
void OnDeinit(const int reason) { //ObjectsDeleteAll(0, short_lbl); ObjectDelete(0, unique_lbl_01 + "bg_box"); ObjectDelete(0, unique_lbl_01 + "edit"); }
I remove all the required object in a single line, it has nothing with the problem. It's when removing the EA.
Thanks for your time & respond. I really appreciate it.
Hi
I don’t think it’s possible in mt4 there are not many options to manage the edit windows. It’s flickering during editing since EA is trying to “recover” every tick this value which is written.
You can try to “display” panel in the OnTimer function, so you can set timer to 5 seconds or some longer time, then it won’t “flicker” through those 5 seconds - it’s enough time to write a value in the window. But align is not possible to set differently.
You can try to use some guide or some other application and made a panel in an outside app (using dll). Then you have more options to make it look and work as you wish.
Best Regards
//+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { Create_TradingPanel(X_Panel,Y_Panel); }
How do you think it would work? Analyse this and you should see the problem. The solution above with align center is okay. Process your editing task within
OnChartEvent()
Hi
I don’t think it’s possible in mt4 there are not many options to manage the edit windows. It’s flickering during editing since EA is trying to “recover” every tick this value which is written.
You can try to “display” panel in the OnTimer function, so you can set timer to 5 seconds or some longer time, then it won’t “flicker” through those 5 seconds - it’s enough time to write a value in the window. But align is not possible to set differently.
You can try to use some guide or some other application and made a panel in an outside app (using dll). Then you have more options to make it look and work as you wish.
Best Regards
Hi,
There seems to be no direct way to solve the problem of edit boxt vertical alignment in MQL.
I put the panel in the OnTimer() with a longer time, 5 sec 10 sec 50 seconds, it does not solve the problem. Edit box text still flickers during editing.
I actually disabled the panel in the OnTick() & OnTimer. It is only drawn in OnInit(). It still flickers. I guess it is a bug or has something to do with redrawing charts by the MetaTrader.
Thanks for the respond. Wish you all the best.
What is your logic in implementing this here?
How do you think it would work? Analyse this and you should see the problem. The solution above with align center is okay. Process your editing task within
As I said in the above post I removed the panel creation void, it still flickers.
It has nothing to do with OnTick OnTImer OnChartEvent, it seems to be some sort of a shortcoming of MT.
Anyhow, thanks for your time and attention. I really appreciate it.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use