?? taxi.vb
字號:
Me.Label3.ForeColor = System.Drawing.Color.Red
Me.Label3.Location = New System.Drawing.Point(48, 64)
Me.Label3.Size = New System.Drawing.Size(120, 20)
Me.Label3.Text = "公里后每公里價格為"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.NWrite)
Me.GroupBox2.Controls.Add(Me.Night)
Me.GroupBox2.Controls.Add(Me.GroupBox3)
Me.GroupBox2.Controls.Add(Me.Button1)
Me.GroupBox2.Controls.Add(Me.Fee)
Me.GroupBox2.Controls.Add(Me.Label8)
Me.GroupBox2.Controls.Add(Me.ThisTime)
Me.GroupBox2.Controls.Add(Me.thisDistance)
Me.GroupBox2.Controls.Add(Me.Label7)
Me.GroupBox2.Controls.Add(Me.Label6)
Me.GroupBox2.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold)
Me.GroupBox2.Location = New System.Drawing.Point(8, 118)
Me.GroupBox2.Size = New System.Drawing.Size(224, 114)
Me.GroupBox2.Text = "本次乘車計價"
'
'NWrite
'
Me.NWrite.Location = New System.Drawing.Point(96, 90)
Me.NWrite.Size = New System.Drawing.Size(120, 20)
Me.NWrite.Text = "寫入乘車記錄"
'
'Night
'
Me.Night.Location = New System.Drawing.Point(8, 90)
Me.Night.Size = New System.Drawing.Size(104, 20)
Me.Night.Text = "是否有夜計?"
'
'GroupBox3
'
Me.GroupBox3.Controls.Add(Me.ZK)
Me.GroupBox3.Controls.Add(Me.Lable)
Me.GroupBox3.Controls.Add(Me.Label9)
Me.GroupBox3.Location = New System.Drawing.Point(160, 9)
Me.GroupBox3.Size = New System.Drawing.Size(64, 56)
'
'ZK
'
Me.ZK.Location = New System.Drawing.Point(8, 32)
Me.ZK.Size = New System.Drawing.Size(32, 21)
Me.ZK.Text = "10"
'
'Lable
'
Me.Lable.Location = New System.Drawing.Point(8, 8)
Me.Lable.Size = New System.Drawing.Size(48, 20)
Me.Lable.Text = "折扣:"
'
'Label9
'
Me.Label9.Location = New System.Drawing.Point(40, 32)
Me.Label9.Size = New System.Drawing.Size(16, 20)
Me.Label9.Text = "折"
'
'Button1
'
Me.Button1.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Button1.Location = New System.Drawing.Point(168, 66)
Me.Button1.Size = New System.Drawing.Size(48, 20)
Me.Button1.Text = "計算"
'
'Fee
'
Me.Fee.Enabled = False
Me.Fee.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Fee.ForeColor = System.Drawing.Color.Red
Me.Fee.Location = New System.Drawing.Point(94, 64)
Me.Fee.Size = New System.Drawing.Size(58, 22)
Me.Fee.Text = ""
'
'Label8
'
Me.Label8.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Label8.ForeColor = System.Drawing.Color.Magenta
Me.Label8.Location = New System.Drawing.Point(8, 64)
Me.Label8.Text = "本次乘車費用:"
'
'ThisTime
'
Me.ThisTime.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.ThisTime.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
Me.ThisTime.Location = New System.Drawing.Point(112, 40)
Me.ThisTime.Size = New System.Drawing.Size(40, 22)
Me.ThisTime.Text = "0"
'
'thisDistance
'
Me.thisDistance.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.thisDistance.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
Me.thisDistance.Location = New System.Drawing.Point(112, 16)
Me.thisDistance.Size = New System.Drawing.Size(40, 22)
Me.thisDistance.Text = ""
'
'Label7
'
Me.Label7.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Label7.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
Me.Label7.Location = New System.Drawing.Point(8, 40)
Me.Label7.Size = New System.Drawing.Size(120, 20)
Me.Label7.Text = "本次乘車等待時間:"
'
'Label6
'
Me.Label6.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Label6.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
Me.Label6.Location = New System.Drawing.Point(8, 16)
Me.Label6.Size = New System.Drawing.Size(104, 20)
Me.Label6.Text = "本次乘車公里數:"
'
'N1
'
Me.N1.Location = New System.Drawing.Point(7, 241)
Me.N1.Size = New System.Drawing.Size(16, 20)
Me.N1.Text = "1"
'
'N2
'
Me.N2.Location = New System.Drawing.Point(26, 241)
Me.N2.Size = New System.Drawing.Size(16, 20)
Me.N2.Text = "2"
'
'N4
'
Me.N4.Location = New System.Drawing.Point(64, 241)
Me.N4.Size = New System.Drawing.Size(16, 20)
Me.N4.Text = "4"
'
'N3
'
Me.N3.Location = New System.Drawing.Point(45, 241)
Me.N3.Size = New System.Drawing.Size(16, 20)
Me.N3.Text = "3"
'
'N8
'
Me.N8.Location = New System.Drawing.Point(140, 241)
Me.N8.Size = New System.Drawing.Size(16, 20)
Me.N8.Text = "8"
'
'N7
'
Me.N7.Location = New System.Drawing.Point(121, 241)
Me.N7.Size = New System.Drawing.Size(16, 20)
Me.N7.Text = "7"
'
'N6
'
Me.N6.Location = New System.Drawing.Point(102, 241)
Me.N6.Size = New System.Drawing.Size(16, 20)
Me.N6.Text = "6"
'
'N5
'
Me.N5.Location = New System.Drawing.Point(83, 241)
Me.N5.Size = New System.Drawing.Size(16, 20)
Me.N5.Text = "5"
'
'N0
'
Me.N0.Location = New System.Drawing.Point(178, 241)
Me.N0.Size = New System.Drawing.Size(16, 20)
Me.N0.Text = "0"
'
'N9
'
Me.N9.Location = New System.Drawing.Point(159, 241)
Me.N9.Size = New System.Drawing.Size(16, 20)
Me.N9.Text = "9"
'
'Ndot
'
Me.Ndot.Location = New System.Drawing.Point(197, 241)
Me.Ndot.Size = New System.Drawing.Size(16, 20)
Me.Ndot.Text = "."
'
'NBack
'
Me.NBack.Location = New System.Drawing.Point(216, 241)
Me.NBack.Size = New System.Drawing.Size(16, 20)
Me.NBack.Text = "C"
'
'Timer1
'
Me.Timer1.Enabled = True
Me.Timer1.Interval = 60000
'
'Form1
'
Me.Controls.Add(Me.NBack)
Me.Controls.Add(Me.Ndot)
Me.Controls.Add(Me.N0)
Me.Controls.Add(Me.N9)
Me.Controls.Add(Me.N8)
Me.Controls.Add(Me.N7)
Me.Controls.Add(Me.N6)
Me.Controls.Add(Me.N5)
Me.Controls.Add(Me.N4)
Me.Controls.Add(Me.N3)
Me.Controls.Add(Me.N2)
Me.Controls.Add(Me.N1)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Menu = Me.MainMenu1
Me.Text = "出租車計價程序"
End Sub
#End Region
Dim iStartFee, iStartDistance As Integer
Dim iDistance, iPrice1, iPrice2 As Integer
Dim iThisDistance, iThisTime As Double
Dim iFee, iZK As Double
Dim iFocus As Integer
Dim iStartTime As Integer
Dim fullname As String '可執行文件含路徑
Dim myAppPath As String
Dim cn As System.Data.SqlServerCe.SqlCeConnection
Dim SQL As String
Dim SQLEngine As System.Data.SqlServerCe.SqlCeEngine
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
fullname = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase
myAppPath = System.IO.Path.GetDirectoryName(fullname) '全局可執行文件路徑變量
Call CreateDatabase()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If thisDistance.Text = "" Then
MsgBox("請輸入本次乘車的公里數!", MsgBoxStyle.Information, "請輸入")
Return
End If
If ThisTime.Text = "" Then
MsgBox("請輸入本次乘車的等待時間!", MsgBoxStyle.Information, "請輸入")
Return
End If
iThisDistance = thisDistance.Text
iThisTime = ThisTime.Text
iZK = ZK.Text
iStartFee = StartFee.Text
iDistance = Distance.Text
iStartDistance = StartDistance.Text
iStarttime = StartTime.Text
If iThisDistance > 10 Then
iFee = (iStartFee + (iThisDistance - iDistance) * 3 + (iDistance - iStartDistance) * 2 + (iThisTime - iStartTime) / 5 * 2) * iZK / 10
If Night.Checked = True Then iFee = iFee * 1.3
If iFee - System.Math.Floor(iFee) > 0.5 Then
iFee = System.Math.Ceiling(iFee)
Else
iFee = System.Math.Floor(iFee)
End If
Fee.Text = Str(System.Math.Floor(iFee)) + "元"
Else
iFee = (iStartFee + (iThisDistance - iStartDistance) * 2 + (iThisTime - iStartTime) / 5 * 2) * iZK / 10
If iFee <= 10 Then iFee = 10
If Night.Checked = True Then iFee = iFee * 1.3
If iFee - System.Math.Floor(iFee) > 0.5 Then
iFee = System.Math.Ceiling(iFee)
Else
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -