| | |
help with windows form applications
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
I need to assign code to a button, that when clicked on, validates an ISBN code, and displays a message that it is either Valid or Invalid. I basically need help transforming code used in a console application that will now be used in a windows form application, so no more writeline stuff, now message boxes.
Here is the code I need help with:
Also, how do I make a connection between a button and textbox. In other words, if a button is clicked on, how do I assign it to read that certain textbox where the information was entered?
Here is the code I need help with:
VB.NET Syntax (Toggle Plain Text)
Select Case ISBN.Length Case 10 Dim x As Integer = 0 noCheck = ISBN.Substring(0, ISBN.Length - 1) x = checkISBN10(ISBN, noCheck) If x = 11 Then noCheck += "0" ElseIf x = 10 Then noCheck += "X" Else noCheck += x.ToString End If If (ISBN <> noCheck) Then System.Console.WriteLine("Invalid ISBN - Check digit is " & x) End If Case Else System.Console.WriteLine("Invalid ISBN length") End Select Private Function checkISBN10( _ ByVal ISBN As String, ByVal noCheck As String) As Integer Dim x As Integer = 0 If ISBN.Length = 10 Then x = 10 * Integer.Parse(noCheck.Chars(0)) x += 9 * Integer.Parse(noCheck.Chars(1)) x += 8 * Integer.Parse(noCheck.Chars(2)) x += 7 * Integer.Parse(noCheck.Chars(3)) x += 6 * Integer.Parse(noCheck.Chars(4)) x += 5 * Integer.Parse(noCheck.Chars(5)) x += 4 * Integer.Parse(noCheck.Chars(6)) x += 3 * Integer.Parse(noCheck.Chars(7)) x += 2 * Integer.Parse(noCheck.Chars(8)) x = 11 - (x Mod 11) End If Return x End Function
Also, how do I make a connection between a button and textbox. In other words, if a button is clicked on, how do I assign it to read that certain textbox where the information was entered?
![]() |
Similar Threads
- upload download any file type to sql DB using c# windows form (C#)
- Windows form Application (C++)
- Autorefresh Windows Form (VB.NET)
- Declaration of string header with Windows Form Application (GUI) (C++)
- Area in Windows Form! (C#)
- Windows Form - saving a database of structs (C++)
- C# Windows Form side Slide Menu (C#)
- Passing arguments from Windows form to a Windows service in C# (C#)
- Need Help in Windows form inC# (C#)
- "Not Responding" Message in Windows Form Application (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: A lot of subs into only one
- Next Thread: FTP url in address bar??
| Thread Tools | Search this Thread |
.net .net2008 30minutes 2005 2008 access account arithmetic array basic bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dropdownlist excel fade file-dialog filter folder ftp generatetags google gridview hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters peertopeervideostreaming picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





