Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom grid for buttons

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Custom grid for buttons

    I have WPF buttons for ATM strategy. I wanna move them in 2 columns. Any educational resources to do this? Preferably simple.
    Is it possible to move buttons on panel 2 where my indicators are plotted?
    Thanks.
    Attached Files

    #2
    As I understand I should change this part:

    Code:
     System.Windows.Controls.ColumnDefinition column1 = new System.Windows.Controls.ColumnDefinition();
    System.Windows.Controls.ColumnDefinition column2 = new System.Windows.Controls.ColumnDefinition();
    System.Windows.Controls.ColumnDefinition column3 = new System.Windows.Controls.ColumnDefinition();
    System.Windows.Controls.ColumnDefinition column4 = new System.Windows.Controls.ColumnDefinition();
    System.Windows.Controls.ColumnDefinition column5 = new System.Windows.Controls.ColumnDefinition();
    
    myGrid.ColumnDefinitions.Add(column1);
    myGrid.ColumnDefinitions.Add(column2);
    myGrid.ColumnDefinitions.Add(column3);
    myGrid.ColumnDefinitions.Add(column4);
    myGrid.ColumnDefinitions.Add(column5);
    Code:
     System.Windows.Controls.Grid.SetColumn(longButton, 0);
    System.Windows.Controls.Grid.SetColumn(shortButton , 1);
    
    System.Windows.Controls.Grid.SetColumn(pendinglong Button, 2);
    System.Windows.Controls.Grid.SetColumn(pendingshor tButton, 3);
    System.Windows.Controls.Grid.SetColumn(beButton, 4);
    Last edited by Leeroy_Jenkins; 01-21-2021, 04:59 AM.

    Comment


      #3
      Hello Leeroy_Jenkins,

      Thank you for your reply.

      You can reduce your number of columns to 2 and add some rows to the columns to contain your buttons. Here's a publicly available example from Microsoft's documentation of adding rows to columns using C# code and placing content in the correct column/row location:



      As far as moving the buttons to the panel with the indicator, if you wanted to do that you should have the indicator add the buttons and have the indicator trigger methods within the strategy to submit orders from them. A script accessing the UserControlCollection will only have that on the panel it is added to.

      Please let us know if we may be of further assistance to you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      58 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      34 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      195 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      360 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      281 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X