| | |
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 2008 access account advanced application array basic beginner browser button buttons center click code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic excel exists fade filter forms ftp generatetags html images input insert intel internet listview map mobile module monitor msaccess net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem regex right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey table temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





