Hi! It looks like you're dynamically creating combo boxes in a loop and adding them to dialogs, but you're encountering some issues. When resizing the combo array with ArrayResize(combo, count + 1);, make sure that count is incremented properly. Similarly, ensure that dialog2 is resized if it's an array.
Hi! It looks like you're dynamically creating combo boxes in a loop and adding them to dialogs, but you're encountering some issues. When resizing the combo array with ArrayResize(combo, count + 1);, make sure that count is incremented properly. Similarly, ensure that dialog2 is resized if it's an array.
Hi Larry! Thank you for your reply. but, alas, this is not the case... I checked the correctness of the arrays, everything is ok. I suspect the problem here is:
void OnChartEvent ( const int id, const long & lparam, const double & dparam, const string & sparam) { dialog1.OnEvent(id,lparam,dparam,sparam); for ( int i= 0 ;i< ArraySize (dialog2);i++) { if (dialog2[i].IsVisible())dialog2[i].OnEvent(id,lparam,dparam,sparam); } if (id== CHARTEVENT_OBJECT_CLICK ) { for ( int i= 0 ;i< ArraySize (button1);i++) { if (sparam==button1[i].Name()) { if (button1[i].Pressed()) { if (button1[i].ColorBackground()==PastColor) { MessageBox ( "The event has already passed! Trade is impossible!" , "Trade is impossible" , MB_ICONWARNING ); button1[i].Pressed( false ); } else { button1[i].ColorBackground(PressedColor); ChangeLineColor(button1[i].Text(),PressedColor); if (!dialog2[i].IsVisible())dialog2[i].Show(); } } else HideDialog2(i); } else if (sparam==button2[i].Name())HideDialog2(i); } } ChartRedraw (); }
But of course I'm not sure...
When you create the dialogs set different dialog IDs for each new dialog and make sure that the difference is more than the number of controls used in each.
//dialog1.Id(0) this does not need to be set as that is the default dialog2[0].Id(100) // if dialog1 has less than 100 controls dialog2[1].Id(200) // if dialog2[0] has less than 100 controls //etc..
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi to all! I have a problem: several comboBoxes are created (the number is not fixed), the class object is created as an array
Then I create the ComboBoxes themselves:
But I get this strange behavior:
Can anyone help? Tell me what I did wrong?