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 NullPointStrategies, Today, 05:17 AM
      0 responses
      52 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      43 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      47 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X