How to move the panel position in cTrader

We can’t drag & drop the panel in cTrader, but what if I want to change the panel position just like a drag & drop? ok, I will show you how to do that! 😁

Although we can’t drag & drop the panel, but we can also change the position with the keyboard help. For example, click the [su_label type=”important”]Ctrl + Mouse Left Button[/su_label] and can do something! So we can use the chart’s MouseDown even for that:

//define the mouse down event
Chart.MouseDown += Chart_MouseDown;

In mouse down event, we can check the keyboard event, when press the key “Ctrl” and then change the panel’s position:

Do you want to be a good trading in cTrader?   >> TRY IT! <<
private void Chart_MouseDown(ChartMouseEventArgs obj)
{
    //check if press the Ctrl key, you also can use other keys
    if (obj.CtrlKey)
    {
        Chart.IsScrollingEnabled = false;
        //base on muse event to get the X,Y coordinate and setup the panel position by margin
        var left = Chart.Width - obj.MouseX > 160 ? obj.MouseX : obj.MouseX - 160;
        var right = Chart.Height - obj.MouseY > 100 ? obj.MouseY : obj.MouseY - 100;
        objPanel.Margin = new Thickness(left, right, 0, 0);
    }
}

The result will like below, when I click the Ctrl + Mouse just can change the panel position:

And you can go to below link for download the information pad for cTrader

https://ctrader.com/algos/indicators/show/2541

Loading

Views: 30
Total Views: 275 ,

Leave a Reply

Your email address will not be published. Required fields are marked *