Spell check text box – Example of a WPF control in AX
This post shows how to add ‘Microsoft Word’ like spell checking to standard AX forms, taking the label editor as an example:

Spell check control in AX
When a word is misspelled it will underline that word red, and right-clicking will show a context menu with alternative suggestions.
The user control and xpo are both available to download, with instructions to install at axaptapedia (see link at the bottom of this post).
How it was built
The first step is to create the user control in Visual Studio 2008.
All there is to the user control is a WPF Textbox – which has spell checking built in!
All you need to do is set the SpellCheck.IsEnabled property::
<TextBox Name="textBox" SpellCheck.IsEnabled="True" Language="en-gb"></TextBox>
This user control then needs to be exposed as an ActiveX to be used in Dynamics AX. (A very helpful colleague of mine gave me some guidance on this.)
Please see this link (MSDN Tutorial: Create a Win32 Application Hosting WPF Content) for an example on how to do this.
To automatically deploy to clients
In AX, make use of the SysFileDeployer framework. To do this subclass SysFileDeploymentDLL, ensuring that you override the filename method to return the name of your library.
Also if you have developed a .Net WPF control you will need to register the library using regasm instead of regsvr32, so make sure you override (or inherit) the register and unregister methods so that regasm is used:
class SysFileDeployment_DevWpf extends SysFileDeploymentDLL
{
#Define.regasmCommand(@'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe')
}
public Filename filename()
{
return 'WpfTextBoxControlLibActiveX.dll';
}
protected void register(boolean atReboot = false)
{
;
WinAPI::setCurrentDirectory(this.destinationPath());
//TODO Check regasm executable exists on client?
WinAPI::shellExecute(#regasmCommand, strfmt('"%1" %2', this.destinationPath()+this.filename(),'/codebase'));
}
protected void unRegister()
{
;
WinAPI::setCurrentDirectory(this.destinationPath());
//TODO Check regasm executable exists on client?
WinAPI::shellExecute(#regasmCommand, this.destinationPath()+this.filename()+' /unregister');
}
Then add your class(es) to the SysFileDeployer filesToDeploy method:
private static container filesToDeploy()
{
;
return [classnum(SysFileDeployment_DevWpfMainControl), classnum(SysFileDeployment_DevWpf)];
}
Then ensure that your dll’s are shared on your server (copy them to your %AXDIR%/50/Client/Share/Include directory on your AOS server) and either update the application version of AX, or delete the usage data for the SysFileDeployer job for each client, then each client that starts up will get the option to deploy your new libraries:

Download the control and example xpo here from axaptapedia
The steps for installing the control into your label editor can also be found here at axaptapedia
Hi Greg,
Do you have the Visual Studio project for this control?
Barry
December 16, 2009 at 12:21 pm
Hi
I had to rewrite some methods in these Ax-classes, since the sourcepath() was called from client sometimes and server sometimes. Also the register/unregister methods (not used in your example) failed, since the full path of the file was not surrounded by ” “.
/Jonas
Jonas
January 8, 2010 at 12:09 pm