home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / ch_code / ch08 / playdays / playdays.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-02-20  |  3.5 KB  |  98 lines

  1. VERSION 5.00
  2. Begin VB.Form PlayDays 
  3.    Caption         =   "Play Days"
  4.    ClientHeight    =   4500
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1470
  7.    ClientWidth     =   4140
  8.    LinkTopic       =   "PlayWave"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   4500
  11.    ScaleWidth      =   4140
  12.    Begin VB.CommandButton Play 
  13.       Caption         =   "Sunday"
  14.       Height          =   495
  15.       Index           =   6
  16.       Left            =   720
  17.       TabIndex        =   6
  18.       Top             =   3720
  19.       Width           =   2535
  20.    End
  21.    Begin VB.CommandButton Play 
  22.       Caption         =   "Saturday"
  23.       Height          =   495
  24.       Index           =   5
  25.       Left            =   720
  26.       TabIndex        =   5
  27.       Top             =   3120
  28.       Width           =   2535
  29.    End
  30.    Begin VB.CommandButton Play 
  31.       Caption         =   "Friday"
  32.       Height          =   495
  33.       Index           =   4
  34.       Left            =   720
  35.       TabIndex        =   4
  36.       Top             =   2520
  37.       Width           =   2535
  38.    End
  39.    Begin VB.CommandButton Play 
  40.       Caption         =   "Thursday"
  41.       Height          =   495
  42.       Index           =   3
  43.       Left            =   720
  44.       TabIndex        =   3
  45.       Top             =   1920
  46.       Width           =   2535
  47.    End
  48.    Begin VB.CommandButton Play 
  49.       Caption         =   "Monday"
  50.       Height          =   495
  51.       Index           =   0
  52.       Left            =   720
  53.       TabIndex        =   2
  54.       Top             =   120
  55.       Width           =   2535
  56.    End
  57.    Begin VB.CommandButton Play 
  58.       Caption         =   "Wednesday"
  59.       Height          =   495
  60.       Index           =   2
  61.       Left            =   720
  62.       TabIndex        =   1
  63.       Top             =   1320
  64.       Width           =   2535
  65.    End
  66.    Begin VB.CommandButton Play 
  67.       Caption         =   "Tuesday"
  68.       Height          =   495
  69.       Index           =   1
  70.       Left            =   720
  71.       TabIndex        =   0
  72.       Top             =   720
  73.       Width           =   2535
  74.    End
  75. Attribute VB_Name = "PlayDays"
  76. Attribute VB_GlobalNameSpace = False
  77. Attribute VB_Creatable = False
  78. Attribute VB_PredeclaredId = True
  79. Attribute VB_Exposed = False
  80. Option Explicit
  81.     Private Declare Function mciSendStringA Lib "WinMM" _
  82.         (ByVal mciCommand As String, ByVal returnStr As String, _
  83.         ByVal returnLength As Integer, ByVal callBack As Integer) As Long
  84. Private Sub Play_Click(Index As Integer)
  85.     Dim errorCode As Integer
  86.     Dim returnStr As Integer
  87.     Dim cmd As String * 255
  88.     cmd = "open " & App.Path & "\days.wav type waveaudio alias days"
  89.     errorCode = mciSendStringA(cmd, returnStr, 255, 0)
  90.     If Index = 0 Then errorCode = mciSendStringA("play days from 150 to 850 wait", returnStr, 255, 0)
  91.     If Index = 1 Then errorCode = mciSendStringA("play days from 1200 to 1900 wait", returnStr, 255, 0)
  92.     If Index = 2 Then errorCode = mciSendStringA("play days from 2200 to 2900 wait", returnStr, 255, 0)
  93.     If Index = 3 Then errorCode = mciSendStringA("play days from 3100 to 4000 wait", returnStr, 255, 0)
  94.     If Index = 4 Then errorCode = mciSendStringA("play days from 4300 to 4900 wait", returnStr, 255, 0)
  95.     If Index = 5 Then errorCode = mciSendStringA("play days from 5100 to 5800 wait", returnStr, 255, 0)
  96.     If Index = 6 Then errorCode = mciSendStringA("play days from 6100 to 6800 wait", returnStr, 255, 0)
  97. End Sub
  98.