Always an ISSUE

 

Always an issue with combo box. I have read every single question asked in the past and I still can't figure out why this combo box is not selecting items when I hover  on the list :(

Here is my code. Please can anyone tell why it is not selecting?

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
#include <Controls\ComboBox.mqh>

CComboBox combo;
int OnInit()
  {
   combo.Create(0, "TPL combo1", 0, 10, 20, 150, 70);
   combo.AddItem("Trend alert", 0);
   combo.AddItem("Break alert", 1);
   combo.ListViewItems(2);
   return (INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam)
  {
   combo.OnEvent(id, lparam, dparam, sparam);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int reason = 0)
  {
   combo.Destroy(0);
  }
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
//--- return value of prev_calculated for next call
   return(rates_total);
  }
Graphical Interfaces V: The Combobox Control (Chapter 3)
Graphical Interfaces V: The Combobox Control (Chapter 3)
  • www.mql5.com
In the first two chapters of the fifth part of the series, we developed classes for creating a scrollbar and a view list. In this chapter, we will speak about creating a class for the combobox control. This is also a compound control containing, among others, elements considered in the previous chapters of the fifth part.
 
Open MetaEditor, check this out:

MQL5\Indicators\Examples\Panels\SimplePanel

Good luck.
 
Soewono Effendi #:
Open MetaEditor, check this out:


Good luck.

No combo box in the example. So not helpful but thanks!

 
if you have solution please share. It's driving me nuts :(
 
Chioma Obunadike #:

No combo box in the example. So not helpful but thanks!

Can you read MQL code ?

MQL5\Indicators\Examples\Panels\ChartPanel
 
Soewono Effendi #:

Can you read MQL code ?

No, I can’t. Can you?
 

Wish you all the best  here in the forum.

 
Soewono Effendi #:

Wish you all the best  here in the forum.

Still not helpful