Combobox bug

Created at 09 May 2023, 00:11
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
DelFonseca's avatar

DelFonseca

Joined 25.06.2017

Combobox bug
09 May 2023, 00:11


Hi,

I was testing the indicator I am developing and came across a ctrader bug.

For example, with the code below, selecting "Item 2", change chart tab and go back to the tab where we have the indicator, it should keep "Item 2" selected but visually it's without any information, as if it were empty. I have tried to solve it via code, but the logs return "Item 2" selected, I believe it is a visual bug. Can someone test it please?

Thanks in advance
 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo
{
    [Indicator(AccessRights = AccessRights.None)]
    public class ComboBoxTest : Indicator
    {
        private ComboBox myDropList;

        protected override void Initialize()
        {
            myDropList = new ComboBox
            {   
                Width = 100,
                Height = 20,
                HorizontalContentAlignment = HorizontalAlignment.Center,
                VerticalContentAlignment = VerticalAlignment.Center
            };
            
            myDropList.AddItem("Item 1");
            myDropList.AddItem("Item 2");
            myDropList.AddItem("Item 3");
            
            Chart.AddControl(myDropList);
        }

        public override void Calculate(int index)
        {
            //...
        }
    }
}

 


@DelFonseca
Replies

Spotware
09 May 2023, 08:05

Hi DelFonseca, 

Thank you for reporting this issue. It's a bug and it will be resolved in an upcoming update of cTrader.

Best regards,

cTrader Team


@Spotware