Skip to content

ButtonClickEventArgs

Summary

Represents the button click event data.

Signature

1
public class ButtonClickEventArgs

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 using cAlgo.API;
 namespace cAlgo
 {
     // This example shows how to use the Button object Click event ButtonClickEventArgs
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class ButtonClickEventArgsSample : Indicator
     {
         protected override void Initialize()
         {
             var button = new Button
             {
                 Text = "Button not clicked yet",
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center
             };
             // Whenever you click on the button the Button_Click method will be called
             button.Click += Button_Click;
             Chart.AddControl(button);
         }
         // Here we change the button test when it is clicked
         private void Button_Click(ButtonClickEventArgs obj)
         {
             obj.Button.Text = "Button Clicked";
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():    
     def initialize(self):
         button = Button()
         button.Text = "Button not clicked yet"
         button.HorizontalAlignment = HorizontalAlignment.Center
         button.VerticalAlignment = VerticalAlignment.Center
         # Whenever you click on the button the on_button_click method will be called
         button.Click += self.on_button_click
         api.Chart.AddControl(button)
     def on_button_click(self, args):
         # Here we change the button test when it is clicked
         args.Button.Text = "Button Clicked"

See Also

Properties

Button

Summary

Gets the button data.

Signature

1
public Button Button {get;}

Return Value

Button

Related Tutorials