The Infolog

A blog of Dynamics AX development tips and tricks

Skip to: Content | Sidebar | Footer

Using a Custom .net Control within AX 2012

30 September, 2013 (09:43) | Uncategorized | By: Howard Webb

I have developed a form using a 3rd party .net control and used this within a Dynamics Ax form in AX 2012. The control I used was the Amazing progress bar found here:

To use a custom .net control firstly you will need to add the reference DLL file to all client.

Adding the DLL

Firstly move the DLL file in to the bin folder of your client (normally C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin). Then within a Dynamics Ax development workspace right click on the reference node in the AOT and select “Add reference”:


In the new screen select browse and then select your DLL. Select your Assembly and click ok. You should now see your reference in the references node:



Adding the control to a form

We will be adding the amazing progress bar to a simple form, however I have also added a .net button and progress bar.

To add the control right click on the design and select a new managed host control:




In the next popup you should see your managed reference:


I then added the other controls:

Make sure that the managed host is auto declared as you will need to set the properties in code.


Add your controls to the class

class FormRun extends ObjectRun



System.Windows.Forms.Button managedButton;

System.Windows.Forms.ProgressBar managedProgressBar;

GAW.AmazingProgressBar _a;



Within the init of your form you can then set the properties of the managed control:


void init()


int i;

System.Drawing.Color colour;

System.Drawing.Graphics g;










//Button settings

managedButton = ManagedHost1.control();


managedButton.add_Click(new ManagedEventHandler(this, ‘managedButtonclicked’));


managedProgressBar = ProgressBar.control();


//progress bar settings





_a = amazing.control();















And then on the method for the button click :


void managedButtonclicked(System.Object sender, System.EventArgs e)



int i;




for(i = 1; i <= 100; i++)











When run it will set the value and run the progress bar:



Further reading:



Print Friendly, PDF & Email


Comment from nanda kishore.v
Time 7th July 2015 at 08:29

hi i am new to ax, i am getting “The method set_MazeStyleInt has not been declared” error can you please suggest me where the code has gone wrong. i am using the same code what you have used

Comment from Howard Webb
Time 23rd July 2015 at 15:53


That method was part of the .DLL and not part of AX. Its possible that they have changed the .DLL since th blog was posted

Comment from thepshkin
Time 27th September 2015 at 19:58

Теплоизоляция дома – строительный портал о теплоизоляцииквартиры поможет вам своими руками утеплить пол , и в результате вы сохраните тепло в доме и комфорт

Write a comment