Home > Plug-in Development > How to use Action DXCore control

How to use Action DXCore control

December 14th, 2010

There are only four important things to make the Action component available and working:

  1. Create a new DXCore plug-in if you haven’t done it yet
  2. Drop the Action control on the plug-in designer surface
  3. Fill the ActionName property
  4. Handle the Execute event

That’s it. Using the ActionName you are able to assign a shortcut key, and once it’s pressed, the Execute event will do its job – perform the code you added into the event handler.

To make Action available inside the Visual Studio’s menu fill the following properties:

  • ButtonText – the caption of the new button
  • CommonMenu – the parent menu where the new button will reside
  • Position – the position inside of the parent menu

DXCore New Action properties

Here is the code of the Execute event handler:

CSharp code:

private void action1_Execute(ExecuteEventArgs ea)
  MessageBox.Show("This is MyButton from the DevExpress menu.");

Visual Basic code:

Private Sub action1_Execute(ByVal ea As ExecuteEventArgs) Handles action1.Execute
  MessageBox.Show("This is MyButton from the DevExpress menu.")
End Sub
  • Next, compile the plug-in
  • Open a new instance of the Visual Studio IDE
  • Load IDE tools if they’re not loaded automatically
  • Verify that the new button appeared inside the DevExpress menu:

DXCore Action button inside menu

Once you click the button inside of a menu or press the specified shortcut, your code inside of the Execute event handler will be executed:

DXCore Action button clicked

Products: DXCore
Versions: 10.1 and up
VS IDEs: any
Updated: Dec/14/2010
ID: D046

Similar Posts:

  1. No comments yet. Be the first and leave a comment!