TX Spell .NET for Windows Forms

Create a .NET Framework Application

Topic

Existing Windows Forms applications often still run on the .NET Framework, and TX Spell .NET works there as well. The result is the same word processor as in Create Your First Windows Forms Application, with spell checking as you type, a context menu and hyphenation. What differs is how the components get into the project: there are no NuGet packages; the setups install the assemblies and create the toolbox tabs.

Prerequisites

  • Visual Studio on Windows with the .NET Framework 4.8.
  • The setups of TX Spell .NET for Windows Forms 11.0 and TX Text Control .NET for Windows Forms 34.0, the full or the trial versions. For .NET Framework projects, they provide the assemblies, the language data and the toolbox tabs. See Installing the Product.

Create the Project

  1. Open Visual Studio and create a new project.

  2. Select C# from the Languages list, Windows from the Platform list and Desktop as the Project Type.

  3. Select the project template Windows Forms App (.NET Framework) and click Next.

    The Create a new project dialog of Visual Studio with the template Windows Forms App (.NET Framework) selected.

  4. Enter a project name, select .NET Framework 4.8 in the Framework list and click Create.

Add the Editor to the Form

  1. With Form1 open in the designer, find the tab TX Text Control 34.0 in the Toolbox. The setup of TX Text Control created it.
  2. Select TextControl and draw the control onto the form.
  3. Click the smart tag in the upper right corner of the TextControl. In the Wizards group, click Add a Ribbon, Add a Status Bar, Add a Ruler and Add a Vertical Ruler, then Arrange Controls Automatically.
  4. Select the ribbon by clicking its blue File tab title and click its smart tag. Click Add a RibbonProofingTab, the tab with the proofing commands, and any other tabs you want, such as Add a RibbonFormattingTab.

Add and Connect the Spell Checker

  1. Find the toolbox tab of TX Spell .NET, which the setup of TX Spell .NET created, and drag TXSpellChecker onto the form. It appears as txSpellChecker1 in the component tray below the form.

  2. Select the TextControl. In the Properties window, open the drop-down list of SpellChecker and select txSpellChecker1.

    The Properties window of textControl1 with the SpellChecker drop-down open and txSpellChecker1 selected, and the smart tag links below.

  3. Set IsSpellCheckingEnabled to True.

  4. To hyphenate words at the end of a line, set IsHyphenationEnabled to True.

  5. To detect the language of the text, set IsLanguageDetectionEnabled to True.

Run the Application

Press F5. The application behaves like the .NET application of the first tutorial: misspelled words are underlined once they are complete, English is checked out of the box, the context menu offers suggestions and opens the spell check dialog, and the last word of a full line is hyphenated. The Proofing tab of the ribbon turns spell checking and hyphenation on and off.

What Is Different in a .NET Framework Project

  • The assemblies come from the setups. The project references TXSpell.dll and TXSpell.Windows.Forms.dll from the Assembly folder of the TX Spell .NET installation, next to the assemblies of TX Text Control.
  • The language data is found in the installation. The spell checker looks for its dictionaries, hyphenation lists, thesaurus files and language recognition data in folders next to the application or, on the development machine, below the Assembly folder of the installation. Nothing needs to be copied while you develop. When you deploy the application, ship the folders Dictionaries, HyphenationLists, SynonymLists and LanguageRecognition with it. See Deploying .NET Framework Applications.
  • The license comes through licenses.licx. In .NET Framework projects, the licenses of TX Text Control and TX Spell .NET are embedded through the project's licenses.licx file when you build. See Licensing for the entries.

The Finished Sample

The setup installs this tutorial as a finished project below TX Spell 11.0.NET for Windows Forms\Samples\WinForms in your Documents folder: CSharp\TextControl\Simple in C#, and VB.NET\TextControl\Simple in Visual Basic.

Next Steps