|
I have only created two programs with VB2008 (iPad, found here for download). I have it perfect for now, well maybe a few flaws, but i would like to add a spell check to it. Dose any one know how to do this? If so please let me know!
Thank you so so much,
Charles |
| ccr05 Monday, April 27, 2009 2:34 AM |
- Edited bykaymaf Monday, April 27, 2009 12:35 PMAdd more info
-
|
| kaymaf Monday, April 27, 2009 12:32 PM |
THis helps but is there a way to do it without word? Like creating a database full of words and if one of the words dont match one its considered missspelled? |
| ccr05 Monday, April 27, 2009 10:21 PM |
That is only way i know if you want to do spell check with Microsoft VS. There may be another ways but you have to do online search. So if you want to create your own words library, that is fine. It will be nice if you have specific words about 1000 but do the whole dictionary will be alot of work. Well good luck kaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on
|
| kaymaf Tuesday, April 28, 2009 12:04 AM |
okay well im new to this so do you know how i would start this? Please help thanks! |
| ccr05 Tuesday, April 28, 2009 12:28 AM |
if you have microsoft office installed on your computer, then you can try to use the code in the above links. kaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on
|
| kaymaf Tuesday, April 28, 2009 2:02 AM |
i know this, but i want to be able to do it without Microsoft Office.
|
| ccr05 Tuesday, April 28, 2009 8:27 PM |
i dont have any other option for you, if dont want to use microsoft word spell check engine in your application.You have to be good in programming in order to create your own words database for spell check. To create a database is the easy part but the code to do the spell check,you have to know regular expression, your searching algorithms, link list, tree and node. try to read about sample program on this link, this is C++ program. http://www.codeproject.com/KB/recipes/spelldictionary.aspx
if you want to buy third-party engine http://www.aspnetspell.com/vb.net-spell-check.aspx http://www.wintertree-software.com/dev/ssce/windowssdk.html
kaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on
|
| kaymaf Tuesday, April 28, 2009 10:53 PM |
okay... well could i copy the microsoft speelchecker into the programs files (the iPad files) so it can be transfered with it when its installed? If so, how would i do this? |
| ccr05 Tuesday, April 28, 2009 11:54 PM |
you are not copy anything, what you have do is to reference to microsoft word object model through Add reference. if you follow those three links above in my first post, it will show you how to do that. kaymaf I hope this helps, if that is what you want, just mark it as answer so that we can move on
|
| kaymaf Wednesday, April 29, 2009 12:26 AM |
Or try this code snippet. I got it from Derek Smyth's post in VB Express forum. This code sample uses one WPF RichtextBox control for spell checking. Imports System.Windows.Forms.Integration Public Class Form1 Public Sub New() ' This call is required by the Windows Form Designer. InitializeComponent() ' allows WPF controls to be hosted in a Win32 application Dim wpfRTFHost As New ElementHost ' create an instance of RTF box and enable SpellCheck Dim wpfRTFBox As New System.Windows.Controls.RichTextBox() System.Windows.Controls.SpellCheck.SetIsEnabled(wpfRTFBox, True) ' hosts the WPF control, fills the window wpfRTFHost.Child = wpfRTFBox wpfRTFHost.Dock = DockStyle.Fill ' add to the Win32 window Me.Controls.Add(wpfRTFHost) End Sub End Class 'Add a reference to PresentationCore.dll, PresentationFramework.dll, WindowsBase.dll, WindowsFormsIntegration.dll
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. |
| Riquel_Dong Wednesday, April 29, 2009 4:13 AM |
unfortuantely that code didnt work.
And i guess im not getting the answer i need. So i guess ill have to try everything i know (which isnt much).
But one more thing, how would i make it so that when someone clicked the X close button in the window it shows a dialog box? Ya know like in notepad, word, wordpad, etc. |
| ccr05 Wednesday, April 29, 2009 11:57 PM |
If you know that you are not getting the answer you want, then close the thread by mark any of the post as answer. Again the question about close X button, this is another question, next time you need to open another thread for that. The code below will do it Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Dim dg As DialogResult dg = MsgBox("Do you want to exit?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "EXIT") If dg = DialogResult.Yes Then 'this block will be executed if dialog result is yes, 'you can do whatever you want here e.Cancel = False Else 'form will not be close, if you click on No e.Cancel = True End If End Sub
kaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on- Edited bykaymaf Thursday, April 30, 2009 4:26 AMtypo
-
|
| kaymaf Thursday, April 30, 2009 4:25 AM |
Hi Ccr05, If you want to add spell check for WinForm application, the above code can satisfy your requirement. Just clarify your scenario why it didn't work for your scenario. About your second issue, you need to handle FormClosing event to implement your requirement. Public Class Form1 Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing If (MessageBox.Show("test", "options", MessageBoxButtons.OKCancel) = Windows.Forms.DialogResult.OK) Then ''other code Else e.Cancel = True End If End Sub End Class Riquel
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. - Marked As Answer byccr05 Saturday, May 02, 2009 3:01 AM
- Unmarked As Answer byccr05 Saturday, August 29, 2009 10:38 PM
-
|
| Riquel_Dong Thursday, April 30, 2009 6:37 AM |
you already post your question again in another thread, just close this thread by mark any of the post as answer so that we can move on kaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on |
| kaymaf Saturday, May 02, 2009 2:43 AM |
okay... thought i did close it my bad! But you aint gotta be a b about it okay. Now if you want me to close it so bad tell me how!!!! |
| ccr05 Saturday, May 02, 2009 3:00 AM |
okay... thought i did close it my bad! But you aint gotta be a b about it okay. Now if you want me to close it so bad tell me how!!!!
lol ccr05.. just found this in your threads, since i replied to one of your posts.. you can not close the thread unless you get a correct answer, and unless the answer is the answer to your question, do not mark anything and unmark the ones that do not help you at all.. nice post by the way.. if you haven't accomplished this, and want to know how to make your own list for the spell check, i might be able to help.. at least you'll have something for starters, if you haven't yet. trujade
help out microsoft for helping you.. test run 7 |
| �trujade.†Sunday, June 28, 2009 3:50 AM |
Hey trujade,
Yeah ive noticed that you have helped me out alot on every thread i have, yeah that would be great, i still havent been able to figure that out yet, and i have been getting a lot of questions about my spell checker on my program and i would like to add it so i can move past that and get on to something else. So thank you! That would be great!!! |
| ccr05 Sunday, June 28, 2009 4:03 AM |
just give me a little bit to get something together to get you started. i haven't done anything with such a topic, but it should not take me long to figure something out.. thanx for the kind words.. trujade.
help out microsoft for helping you.. test run 7 |
| �trujade.†Sunday, June 28, 2009 4:17 AM |
ccr05.. i have tried the whole day to figure out a way how to create a spell check, and no luck whatsoever.. i've googled for ideas, and basically all the links were related to using the msWord app as a reference for the spell check. unless, you are planning on writing the whole english language in a file, to be able to have your app check from there for correct spelling, and have another file that consists of having similar words to those misspelled ones, i'm pretty much out of suggestions. sorry to get your hopes up.. trujade.
help out microsoft for helping you.. test run 7 |
| �trujade.†Monday, June 29, 2009 2:18 AM |
Hi Charles, Please let us see why the above code snippet by using WPF RictTextBox control doesn't work in your scenario. It adds a spell check in RichTextBox control. Let me make a couple of recommendations about asking questions. 1.) The guidelines specifies one question per thread. When that question is answered start another thread with a clearly stated problem in the thread title. 2.) When you have a question about your code, post the code. No one can answer questions about why your code isn't working without seeing the code. 3.) When you have an error, specify exactly what the error is and where it occurs in the code. Minimize the use of pronouns because they are ambiguous. Best regards, Riquel
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. |
| Riquel_Dong Monday, June 29, 2009 7:50 AM |
I havent posted in a while, but i have almost full word list of English dictionary. No words are cap though. The link to download it is below. Does anyone think they can help me make a spell check now? CLICK HERE TO DOWNLOAD |
| ccr05 Saturday, August 29, 2009 10:37 PM |
ccr05 , view following link for a code solution to locate words, no matter how typed.. http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/97c58d33-d9d5-4a2c-867f-90019cdfff77/ second marked answer containing this part. For Each word In Words word = word.ToLower hope it helps. i can see you are dedicate to this spell check.. ;o) about helping you, we always find time. i live here and this is my reason.. trujade. |
| �trujade.†Saturday, August 29, 2009 10:58 PM |
To write your own spell checker is a very big job.The problem is that you are looking for exceptions, so your search for matches has to be very thorough.Some of the things you will need to do are:
Decide what constitutes a word. For instance: - More than one character delineated withspace/newline, pubctuationetc - No embedded caps - No embedded numbers - No first cap unless first word in sentence
Standardise the word - eg, make all lower case, remove any dashes, apostrophe, brackets, quotation marks.
When you are ready to look up the word in the list, you need to consider what the list contains. For instance, the list probably doesn't include plurals of nouns, so if you get a match on everything up to a final s, will you assume that it is the correct spelling for a plural noun?
Does the list include all forms of verbs? If not, then if you get a match on a stem, can you assume it is the correct form of a verb if the unmatched characters are a legal ending (ing, ed etc)? Does your list indicate what endings are legal for each word? How does your list indicate howendings are added (eg, make, making)?
Your lookup of the list will have to be very efficient, or the process will be too slow to be usable.An index to the start of each letter would be useful.Your list willl also have to be compressed. A common form of compression for a sorted list is to use a count character at the start of each entry to indicate how many letters do not change from the previous entry. Eg
m <1>a <2>ce <2>d <3>e <2>gic <5>ian
You can save a lot of space in the file by not using a separator between each word. Setting the high bit of the first or lastcharacter for each word would work.
A checker isn't much use without a suggestion for the correct word, so you wil need to develop an algorithm for guessing what the correct word might be. This will involve scanning the list for legal words (with endings, if required) similar to the mis-spelled word.
|
| Acamar Sunday, August 30, 2009 1:44 AM |
I should mention a few things. Its not going to check for grammer, such as capitalization. Just spelling. And trujade, ill look at your tread and get back to you. wow thats a big thread lol. |
| ccr05 Sunday, August 30, 2009 2:45 AM |