Download presentation
Presentation is loading. Please wait.
Published byJayson Cross Modified over 9 years ago
1
計算機程式及實習及期末報告 題目 : 長榮公司 南臺科技大學 機械工程系 班級 : 奈米一乙 學號 :4A314073 姓名 : 陳紀舜 授課教師 : 謝慶存
2
學習重點 Label 、 LinkLabel 、 MsgBox 、 PictureBox 、 RadioButton 、 TextBox 、 GroupBox 的使用方法
3
版面配置
4
程式碼設計 Public Class Form1 Dim price1 As Integer Dim price2 As Integer Dim quit As Integer Dim result As MsgBoxResult Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged price1 = 0 End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged price1 = 250 End Sub Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged price1 = 300 End Sub Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged price1 = 350 End Sub
5
程式碼設計 Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged price1 = 400 End Sub Private Sub RadioButton6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton6.CheckedChanged price1 = 450 End Sub Private Sub RadioButton7_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton7.CheckedChanged price1 = 500 End Sub Private Sub RadioButton8_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton8.CheckedChanged price1 = 550 End Sub Private Sub RadioButton9_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton9.CheckedChanged price2 = 0 End Sub Private Sub RadioButton10_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton10.CheckedChanged price2 = 250 End Sub
6
程式碼設計 Private Sub RadioButton11_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton11.CheckedChanged price2 = 300 End Sub Private Sub RadioButton12_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton12.CheckedChanged price2 = 350 End Sub Private Sub RadioButton13_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton13.CheckedChanged price2 = 400 End Sub Private Sub RadioButton14_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton14.CheckedChanged price2 = 450 End Sub Private Sub RadioButton15_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton15.CheckedChanged price2 = 550 End Sub Private Sub RadioButton16_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton16.CheckedChanged price2 = 550 End Sub
7
程式碼設計 Private Sub RadioButton17_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton17.CheckedChanged TextBox1.Text = Math.Abs(price1 - price2) * 0.8 End Sub Private Sub RadioButton18_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton18.CheckedChanged TextBox1.Text = Math.Abs(price1 - price2) * 0.5 End Sub Private Sub RadioButton19_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton19.CheckedChanged TextBox1.Text = Math.Abs(price1 - price2) * 0.9 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' Textticket.Text = Math.Abs(price1 - price2) * 0.8 ' Textticket.Text = Math.Abs(price1 - price2) * 0.5 ' Textticket.Text = Math.Abs(price1 - price2) * 0.9 TextBox1.Text = Math.Abs(price1 - price2) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click quit = MsgBox(" 是否結束? ", 36, " 離開 ") If (quit = MsgBoxResult.Yes) Then End ' 程式結束 End If End Sub
8
心得 一開始剛接觸這門課感覺很新奇,很有趣,加上老師幽默 的上課方式,讓我對這門課愛不釋手,希望以後老師能交更多 有趣的東西,讓我們更加喜歡這門課。
9
參考文獻 蔡文龍《 Visual Basic2013 基礎必修課》
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.