-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmTaxCalc.vb
68 lines (53 loc) · 2.38 KB
/
frmTaxCalc.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Imports System.Globalization
Public Class frmTaxCalc
Dim PointClicked As Point
Dim Dragging As Boolean
Private Sub pbMove_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles pbMove.MouseDown
If e.Button = MouseButtons.Left Then
Dragging = True
PointClicked = New Point(e.X, e.Y)
Else
Dragging = False
End If
End Sub
Private Sub pbMove_MouseMove(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles pbMove.MouseMove
If Dragging Then
Dim PointMoveTo As Point
' Find the current mouse position in screen coordinates.
PointMoveTo = Me.PointToScreen(New Point(e.X, e.Y))
' Compensate for the position the control was clicked.
PointMoveTo.Offset(-PointClicked.X, -PointClicked.Y)
' Move the form.
Me.Location = PointMoveTo
End If
End Sub
Private Sub pbMove_MouseUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles pbMove.MouseUp
Dragging = False
End Sub
Private Sub SteamTextBox2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles SteamTextBox2.KeyPress
If Asc(e.KeyChar) <> 8 Then
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
End If
End If
End Sub
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
Me.Close()
End Sub
Private Sub SteamTextBox2_Click(sender As Object, e As EventArgs) Handles SteamTextBox2.Click
SteamTextBox2.Text = ""
End Sub
Private Sub cmdCalc_Click(sender As Object, e As EventArgs) Handles cmdCalc.Click
Try
Dim result15 As Int64 = Convert.ToInt64(SteamTextBox2.Text) * 0.650
Dim result30 As Int64 = Convert.ToInt64(SteamTextBox2.Text) * 0.845
lblWithVP.Text = "With Value Pack: " + result30.ToString("C", CultureInfo.CurrentCulture)
lblWithoutVP.Text = "Without Value Pack: " + result15.ToString("C", CultureInfo.CurrentCulture)
Catch ex As Exception
MsgBox("An error occured... Maybe you fucked the mathematics up (ô,O)")
End Try
End Sub
End Class