1 / 10

計算機程式及實習 期末 報告製作

計算機程式及實習 期末 報告製作. 題目 : 對對碰 學校 : 南台科技大學 系所 : 機械工程系 班級 : 自控一甲 學號 : 4A212034 學生 : 洪濬森 指導老師 : 謝慶存. 題目說明. 只要按出兩相同圖案, 就 成功了 !!. 版面介紹. pic1. pic1. pic1. p ic2. pic1. pic1. 圖片檔. 程式碼. Public Class Form1 Public Class Form1 Dim num1, num2 As Integer

loe
Download Presentation

計算機程式及實習 期末 報告製作

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 計算機程式及實習期末報告製作 題目:對對碰 學校 : 南台科技大學 系所 : 機械工程系 班級 : 自控一甲 學號 :4A212034 學生 : 洪濬森 指導老師 :謝慶存

  2. 題目說明 • 只要按出兩相同圖案,就成功了!!

  3. 版面介紹 • pic1 • pic1 • pic1 • pic2 • pic1 • pic1

  4. 圖片檔

  5. 程式碼 Public Class Form1 • Public Class Form1 • Dim num1, num2 As Integer • Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load • pic1.Enabled = False • pic2.Enabled = False • pic1.SizeMode = PictureBoxSizeMode.StretchImage • pic2.SizeMode = PictureBoxSizeMode.StretchImage • pic1.Image = New Bitmap("Pokerbk.jpg") • pic2.Image = New Bitmap("Pokerbk.jpg") • lblMsg.Text = "按o洗~牌gP鈕s遊C戲﹐開

  6. Private Sub btnShuffle_Click(sender As System.Object, e As System.EventArgs) Handles btnShuffle.Click pic1.Enabled = True pic2.Enabled = True btnShuffle.Enabled = False pic1.Image = New Bitmap("Pokerbk.jpg") pic2.Image = New Bitmap("Pokerbk.jpg") Randomize() num1 = Int(Rnd() * 14) + 1 num2 = Int(Rnd() * 14) + 1 lblMsg.Text = "請D在b圖I片u上W按o一@下U選i取Lu .." My.Computer.Audio.Stop() End Sub

  7. Private Sub pic1_Click(sender As System.Object, e As System.EventArgs) Handles pic1.Click • pic1.Image = New Bitmap("Poker" & num1 & ".jpg") • pic2.Image = New Bitmap("Poker" & num2 & ".jpg") • If num1 > num2 Then • lblMsg.Text = “再試一次" • Else • If num1 = num2 Then • lblMsg.Text = "LUCKY" • My.Computer.Audio.Play(My.Resources.kick, AudioPlayMode.Background) • Else • lblMsg.Text = "再試一次" • End If • End If • pic1.Enabled = False • pic2.Enabled = False • btnShuffle.Enabled = True • End Sub

  8. Private Sub pic2_Click(sender As System.Object, e As System.EventArgs) Handles pic2.Click • pic1.Image = New Bitmap("Poker" & num1 & ".jpg") • pic2.Image = New Bitmap("Poker" & num2 & ".jpg") • If num2 > num1 Then • lblMsg.Text = "Try again" • Else • If num2 = num1 Then • lblMsg.Text = "LUCKY" • My.Computer.Audio.Play(My.Resources.kick, AudioPlayMode.Background) • Else • lblMsg.Text = "Try again" • End If • End If • pic1.Enabled = False • pic2.Enabled = False • btnShuffle.Enabled = True • End Sub

  9. 心得 • 這次的課程讓我學到不少東西,例如程式編輯這方面的東西,希望以後能夠用的到 也很高興能上到這門課程.

  10. 參考文獻 • Visual Basic2010 基礎必修課 • 老師課堂上的教導 • 學長的範例

More Related