Solved

How to create Word's Auto correct like feature for a Text Box on a Form

Posted on 2010-09-19
9
1,204 Views
Last Modified: 2013-11-26
I have text Box (myTextBox) on a Form1 in simple Visual Basic Application for Visual Studio 2008.
I would like to create a Microsoft's Word like auto correct feature for this text box so that if I enter a predefine combination of letter followed by a space then that predefined sequence of letters gets immediately replaced by a predefined word or phrase. For example if I would like have ensure that if the user types hte in the text box followed by space that it should get immediately replace by ( the ) and if the user types whre followed by space, then this should get replaced immediately by ( where ). In other words I am trying to achieve a simple immediate spell check like feature for myTextBox. The only difference is that I am not aiming to create a full dictionary spell check feature, but a spell check for a limited number (10 to 15) of character combinations.

I would appreciate some guidance on the possible ways (approaches I can take ) to achieve this and if there is a piece of code that will help me achieve this I would appreciate if I could have that.

Many thanks for your help in anticipation.

0
Comment
Question by:FaheemAhmadGul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
9 Comments
 
LVL 3

Assisted Solution

by:a_hassaan
a_hassaan earned 175 total points
ID: 33711006
you can handle the OnTextChanged Event of the textbox and get the last word from the text property.

it's there where you will implement your dictionary lookup and replace the word if neccessary.

I think you may make good use of some .net data structures like hash tables and dictionaries for the sake of performance.

if i got more time later i may send you some sample code to do that easy task... but now you can go with the main guidelines above
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33711042
You can use AutoComplete method in append method with CustomSource ....
As you already Asked do you have a source like a dictionary?
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33711044
Sorry there is a class ...i forgot...
Take a look  here
http://msdn.microsoft.com/en-us/library/system.windows.controls.spellcheck.aspx
it is called SpellCheck Class
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33711055
Also you can check the examples and the members of SpellCalss...following links from the above source
0
 
LVL 18

Accepted Solution

by:
John (Yiannis) Toutountzoglou earned 325 total points
ID: 33711100
Ok...Spell Check Deppends on Framework you have ...
try also to read :http://www.componentsource.com/products/componentone-spell-net/index.html
0
 
LVL 1

Author Comment

by:FaheemAhmadGul
ID: 33711490
I think I made some mistake in clicking the right button. I meant to accept the solutions posted by a_hassaan and itoutou, splitting the points 175 and 325. I think by mistake I clicked Close Question button. I hope the points have still been allocated to a_hassaan and itoutou in the way I set them. I am not seeing any option to accept multiple solutions at present. Please let me know if I need to do anything else to give points to a hassaan and itoutou.
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33711494
i think you can make it...try again...
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33711546
0
 
LVL 1

Author Comment

by:FaheemAhmadGul
ID: 33711642
I have requested help from moderators and requested them to accept the solutions on my behalf or make the option to accept multiple solutions available to me again.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question