The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled VisualBasic Code
Posted by: BorgThumpshishead | December 19, 2010 @ 3:32am
VisualBasic Code
[
Download
]
Public Class Form1 Public FinalStr As String Private Sub HomeFtBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles HomeFtBox.KeyPress If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub LandFtBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles LandFtBox.KeyPress If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub YearBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles YearBox.KeyPress If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub ExitButt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButt.Click Me.Close() End Sub Private Sub ClearButt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButt.Click NameBox.Clear() AddressBox.Clear() HomeFtBox.Clear() LandFtBox.Clear() YearBox.Clear() TaxHomeBox.Clear() TaxLandBox.Clear() HomeDiscBox.Clear() LandDiscBox.Clear() TotalBox.Clear() End Sub Private Sub NameBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles NameBox.LostFocus ToProper(NameBox.Text) NameBox.Text = FinalStr End Sub Private Sub AddressBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddressBox.LostFocus ToProper(AddressBox.Text) AddressBox.Text = FinalStr End Sub Private Sub HomeFtBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles HomeFtBox.LostFocus If Val(HomeFtBox.Text) < 0 Then HomeFtBox.Clear() HomeFtBox.Focus() ChgFocus() End If End Sub Private Sub LandFtBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles LandFtBox.LostFocus If Val(LandFtBox.Text) < 0 Then LandFtBox.Clear() LandFtBox.Focus() ChgFocus() End If End Sub Private Sub YearBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles YearBox.LostFocus If Val(YearBox.Text) < 0 Then YearBox.Clear() YearBox.Focus() ChgFocus() End If End Sub Public Sub ChgFocus() MsgBox("You must enter a Posative Value for this field", 64, "Invalid Number") End Sub Public Shared Function ToProper(ByVal Str As String) As String Dim OutStr = String.Empty Dim Words() As String = Split(Str, " ") For A = 0 To Words.GetUpperBound(0) Dim TempWord As String = Words(A) For B = 0 To TempWord.Length - 1 If B = 0 Then OutStr += Char.ToUpper(TempWord(B)) Else OutStr += Char.ToLower(TempWord(B)) End If If A <> Words.GetUpperBound(0) And B = TempWord.Length - 1 Then OutStr += " " End If Next Next FinalStr = OutStr End Function End Class
Syntax Highlighting
[
Open in new window
]
Author Comments
for a friend to check
Rating
4.52 / 8
64 Votes
http://codebin.yi.org/1020
page generated in 0.01 seconds