void InitializeComponents() { // this class is to be generated with the designer this.Button1 = new Button(); this.Button1.setLabel("Start computing"); this.Button1.WithEvents().Click += this.Button1_Clicked; base.add(Button1); this.Button2 = new Button { Enabled = false }; this.Button2.setLabel("Stop computing"); this.Button2.WithEvents().Click += this.Button2_Clicked; base.add(Button2); this.Button3 = new Button {}; this.Button3.setLabel("Compute"); this.Button3.WithEvents().MouseEnter += this.Button3_MouseEnter; this.Button3.WithEvents().MouseExit += this.Button3_MouseExit; base.add(Button3); }
void InitializeComponents() { // this class is to be generated with the designer var a = new Button(); a.setLabel("Click this button"); var a_handler = new Button1_Clicked_Handler { Target = this }; a.addActionListener(a_handler); base.add(a); }