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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      91 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      121 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      72 views
      0 likes
      Last Post PaulMohn  
      Working...
      X