how to check spelling mistakes from two text-boxes - vb.net

i want to compare two text box( data/strings in both text-box). spelling mistakes.if spelling mistakes is occur then that word should be highlighted.
enter code here
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
rd should highlight

This will get very large. I'm not gonna tell you all of this. You should make a seperate file with all the possible words (i would copy and paste from a dictionary) and make a read all lines function. Let a timer check that if a space is entered. The highlight will need to be created with a RICH textbox.
I'm not familiar with rich textboxes, search it up.
For more questions jist ask.

Related

Prevent the introduction of similar characters vb.net

Is it possible to prevent entering characters that are already in the textbox?
like if I wrote in textbox
abcd
Then it is not allowed to write the same letters in it,
I searched and tried but could not find a way
All are about stopping letter gouging
It's pretty simple, just use the following code:
Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
e.Handled = TextBox1.Text.Contains(e.KeyChar)
End Sub
It'll help preventing typing the existing text(s) containing in a TextBox.
Hope it helps you!

Visual Basic GUI Input Validation

I took an entry level computer programming class this past term and I'm having problems with my final project. I have to design a program in visual basic GUI that asks the player to accurately guess a number between 1-100 within a limited number of guesses.
My first form asks the user to set the number of guesses allowed. It has one textbox and an "enter" button, among other buttons that I've gotten to work.
I'm trying to get code to work that will validate the input on the guesses allowed. Specifically, I want a message box to pop up if the player enters letters or special characters instead of numbers, or enters a number less than zero, or greater than twenty. Here's what I have:
Public Class Noofguesses
Shared maxguesscnt As Integer
Private Sub Numberofguesses_TextChanged(sender As Object, e As EventArgs) Handles Numberofguesses.TextChanged
End Sub
Private Sub Quit_Click(sender As Object, e As EventArgs) Handles Quit.Click
End
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Form3.Show()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If Val(Numberofguesses) > 20 Then MsgBox("Number of Guesses Cannot Exceed 20")
If Val(Numberofguesses) < 0 Then MsgBox("Number of Guesses Must Be Greater Than 0")
If Not IsNumeric(Numberofguesses) Then MsgBox("Entry Cannot be Letters or Characters")
Me.Close()
Form2.Show()
End Sub
End Class
What am I doing wrong? Please let me know.
Thanks
I would generally suggest using a NumericUpDown rather than a TextBox, in which case no validation is required. As this is an assignment though, I'm guessing that validating a TextBox is a requirement. In that case, you should use Integer.TryParse to validate a String, i.e. the Text of the TextBox and convert it if it is valid. You can then test the converted value to make sure that it isn't less than zero, etc. I'm not going to write the code for you, given that this is homework, but that should be enough for you to do it yourself or, if you feel you must, find examples online.

Menu Strip Control "Window"

I am working on a project and am just stymied by this. It should be really straight forward. I have included the code so you can see the other Menu Strip Items.
The user has the ability to open as many "Child" forms into the mdiParent form. I would like the "Window" function on the menu strip to populate with the Bank Name found on the Child form so if a user had 10 bank forms open, they could find a specific form by clicking Window and seeing the bank name (the name of the text field which I would like to pull is Bank.lblbank.text) This functionality was found in the 2007 and older versions of many of the Microsoft Suite products.
If I hadn't seen my professor do this in class, I would think it was a bit of proprietary Microsoft Office coding that us mere mortals cannot access. Unfortunately, he whipped it out and I didn't get it captured.
Obviously, I am not asking the right questions on the search engines because I cannot find a clear answer. Does anyone have any advice? This functionality isn't necessary but a little something I want to add. I've worked on this way too long and just want a little bit of success.
Let me know if a zip copy of the project or screen prints would be helpful. I'm happy to send them your way.
Appreciate everyone looking at this post and their feedback. Thank you for your time!
Lauren
Public Class Loan_Evaluator
Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub NewLoanToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NewLoanToolStripMenuItem.Click
Dim NewBank As New Bank
NewBank.MdiParent = Me
NewBank.Show()
End Sub
Private Sub VerticalToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles VerticalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub
Private Sub CascadeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CascadeToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
Private Sub HorizontalToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles HorizontalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub
Private Sub WindowToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles WindowToolStripMenuItem.Click
End Sub
End Class
Select the main MenuStrip control, not the ToolStripMenuItem. So you'd click on MenuStrip1, not WindowToolStripMenuItem, for example. Now change the MdiWindowListItem() property to "Window" (or whatever menu item you want to be populated with open MdiChildren). Done.

How to update value in combo box using combo box text?

I have a very simple question that i can't seem to find the answer, i have looked up and down in google, msdn with no luck...
it's really simple yet i can't seem to wrap my mind around it.
here goes:
If i'm using simple Drop down style combo box(the one that looks like a listbox with textbox attached on top of the cbobx control) when i want to update one of the value in it, once i start typing in the textbox the selection inside the combo box is gone. Thus i can't update the value inside the combo box.
i know i can use a regular text box to do this, but i'd really like to make this work or i would really loose sleep over this.
Thanks in advance for all your help.
Ray
It doesnt seem very intuative editing the selection in a combobox, but the following should do the trick:
Private cbindex As Integer
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
cbindex = ComboBox1.SelectedIndex
End Sub
Private Sub ComboBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.LostFocus
ComboBox1.Items(cbindex) = ComboBox1.Text
End Sub

Dynamic dropdown based on Radio selection

Good morning all! Myself and a co-worker are tasked with a system-wide scripting solution but neither of us are .NET programmers so we need your help.
We have a GUI that displays a radio selection box (3 options) that are the three sites where our hospitals are. We need to dropdown located on the form to fill with only the locations based on the selected radio option.
my gui http://web6.twitpic.com/img/40330741-85d91a5637f2445b322e62df17cf3351.4aef01c5-full.jpg
Here is the code behind we have so far (sorry, VB)
Public Class frmCEHLI
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CELocDataSet.dbo_Locations' table. You can move, or remove it, as needed.
Me.Dbo_LocationsTableAdapter.Fill(Me.CELocDataSet.dbo_Locations)
End Sub
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
MsgBox("Submit button has been pressed")
End Sub
End Class
For the record the Location dropdown is currently databound but its a static SELECT statement which brings us all the locations but we'd prefer it to be cleaner if it only returned the locations based on Site. We are using Visual Basic 2008 Express Edition for development. Any help/code is appreciated, thanks!
Sorry not to respond back sooner, busy, and wanted to dig up a sample that did just what you were needing.
Create two comboboxes on your form. You can bind either fixed values, or from a table on the first combo. Then, from the property/events sheet, first set the "AutoPostBack" to TRUE, then on the events, click for the "SelectedIndexChanged" event to bring up some code.
The "Sender" object parameter will be the combobox itself, so you'll be able to analyse the property settings via debugging to find what key/value was chosen.
Then, run whatever query from your data querying control, business object, or whatever that gets your results, such as to a DataSet or DataTable.
Finally, set the datasource of your second combo to the above result query, set dataTextField and DataValueField and issue DataBind() to the combo.
That should get exactly what you need.
Then, when someone makes a selection from the second combo, you can have code within ITS "SelectedIndexChanged" event (also based on its AutoPostBack or actual submit button on the form).
Hope this helps.
I would create two combobox controls... One for the "where", then, on the InteractiveChange event by the user to post-back to the page using that answer for the second combobox of locations based on the "where" value of the first combo.