Difference between revisions of "Using events in VBA"

From Ribbon Commander Documentation
Jump to: navigation, search
(Subscribing to control events)
(Introduction)
Line 3: Line 3:
  
 
== Introduction ==
 
== Introduction ==
All Dynamic RibbonX controls that model UI elements with delegates support VBA events. [[rxDispatchScope | Local dispatch scope]] is most appropriate for use in VBA classes.
+
All Dynamic RibbonX controls that model UI elements with delegates support VBA events. In order to subscribe to events in VBA we need to write our UI code in a VBA class. Since we are using events instead of delegates, the [[rxDispatchScope | dispatch scope]] of our customUI is irrelevant.
  
 
== Subscribing to control events ==
 
== Subscribing to control events ==
 
* Add a new class to your VBA project and name it clsEventsDemoUI
 
* Add a new class to your VBA project and name it clsEventsDemoUI
 
* Enter the following code to the class module
 
* Enter the following code to the class module

Revision as of 17:04, 17 March 2013

Prerequisites

We recommend you go though Creating an rxCustomUI object with local dispatch scope in VBA before going into this example.

Introduction

All Dynamic RibbonX controls that model UI elements with delegates support VBA events. In order to subscribe to events in VBA we need to write our UI code in a VBA class. Since we are using events instead of delegates, the dispatch scope of our customUI is irrelevant.

Subscribing to control events

  • Add a new class to your VBA project and name it clsEventsDemoUI
  • Enter the following code to the class module