 |
|
|
 |
 |
|
ไม่มีเเนวทางเลยรอ
|
 |
 |
 |
 |
Date :
2011-02-12 09:39:42 |
By :
thanthip |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เเง่ว
|
 |
 |
 |
 |
Date :
2011-02-13 10:44:43 |
By :
thanthip |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
งง อธิบายอีกนิดสิครับ เดี๋ยวช่วยครับ
|
 |
 |
 |
 |
Date :
2011-02-15 11:56:34 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้ได้เเล้วค่ะ อยากจะสอบถามเรื่องไหม่ได้ไหมค่ะ อยากจะไห้มันอ่านเสียงตาม text ยกตัวอย่างการตรวจสอบเทค เเล้วเรียกเสียงออกอ่าค่ะ
ยกตัวอย่างการสร้างฟังชั่น call sound ในโมดุล ก้อได้ค่ะ
ทำเป็นโปรเเกรมบัตรคิว อ่าค่ะ
ขอบพระคุนมากๆค่ะ
|
 |
 |
 |
 |
Date :
2011-02-15 13:57:37 |
By :
thanthip |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Private Sub cmdPlay_Click()
For i = 1 To Len(txtNo.Text)
procPlaySound (Mid(txtNo, i, 1))
Next
End Sub
Private Sub procPlaySound(noSound As Integer)
Select Case noSound
Case 0
mmcAudio.FileName = App.Path & "\Sound\0.mp3"
Case 1
mmcAudio.FileName = App.Path & "\Sound\1.mp3"
Case 2
mmcAudio.FileName = App.Path & "\Sound\2.mp3"
Case 3
mmcAudio.FileName = App.Path & "\Sound\3.mp3"
Case 4
mmcAudio.FileName = App.Path & "\Sound\4.mp3"
Case 5
mmcAudio.FileName = App.Path & "\Sound\5.mp3"
Case 6
mmcAudio.FileName = App.Path & "\Sound\6.mp3"
Case 7
mmcAudio.FileName = App.Path & "\Sound\7.mp3"
Case 8
mmcAudio.FileName = App.Path & "\Sound\8.mp3"
Case 9
mmcAudio.FileName = App.Path & "\Sound\9.mp3"
End Select
mmcAudio.FileName = App.Path & "\Sound\0.mp3"
mmcAudio.Command = "Open"
mmcAudio.Command = "Play"
End Sub
|
 |
 |
 |
 |
Date :
2011-02-15 14:38:05 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมใช้ components ตัวนี้นะครับ

สงสัยก้อถามละกาน
|
ประวัติการแก้ไข 2011-02-15 14:50:05
 |
 |
 |
 |
Date :
2011-02-15 14:42:51 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุนมากเลยค่ะ จะลองทำดูก่อนนะค่ะ เดี่ยวตันเเล้วจะถามนะค่ะ
|
 |
 |
 |
 |
Date :
2011-02-15 16:36:44 |
By :
thanthip |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยดูโคดนี้หน่อยค่ะ
ประมาณนี้ค่ะ บนform จะมี label1(เป็นหมายเลขที่ขาน) ส่วน Label2(จะเป็นช่องบริการค่ะ)
พอจะเเนะนำเเนวทาง ให้มันตรวจสอบ เเล้วเรียกตาเลข อ่าค่ะ
โค๊ตนี้เป๊นโคต โปรเเกรบัตรคิวที่ทำด้วย access 2003 ที่อยุ่ใน modul อีกที ลองเอามาใส่ในvb มานเออเร่อ ทั้งๆที่ โค๊ตเหมือนกัน
Option Explicit
Function ReadOut(intX As Integer, intY As Integer)
Dim i As Integer
i = Len(CStr(intX))
If intX > 1000 Then
Exit Function
Else
Call PlaySound(MyPath & "invite.wav")
If intX >= 100 Then
Call PlaySound(MyPath & left(intX, 1) & ".wav")
Call PlaySound(MyPath & "roi.wav")
End If
intX = right(intX, 2)
If intX >= 30 Then
Call PlaySound(MyPath & left(intX, 1) & ".wav")
End If
If intX >= 20 And intX < 30 Then
Call PlaySound(MyPath & "yee.wav")
End If
If intX >= 10 Then
Call PlaySound(MyPath & "sib.wav")
End If
intX = right(intX, 1)
If intX > 0 Then
If intX = 1 Then
If i = 1 Then
Call PlaySound(MyPath & "1.wav")
Else
Call PlaySound(MyPath & "ed.wav")
End If
Else
Call PlaySound(MyPath & intX & ".wav")
End If
End If
Call PlaySound(MyPath & "at.wav")
Call PlaySound(MyPath & intY & ".wav")
End If
End Function
Function MyPath() As String
Dim strPath As String
strPath = CurrentDb.Name
MyPath = left(strPath, Len(strPath) - Len(Dir(strPath)))
End Function
โค๊ตใน form หลักค่ะ
Option Compare Database
Option Explicit
Private Sub Command1_Click()
Me.Textnum = 1
CallOut Me.ActiveControl.Caption
Me.Txtnum1 = Textnum
Me.Txtno1 = txtNo
End Sub
Function CallOut(intTeller As Integer)
If Me.txtNo >= DLookup("[Numofgard]", "T_Numgard1") Then Me.txtNo = 0
Me.txtNo = Me.txtNo + 1
Me.Repaint
Call ReadOut(Me.txtNo, intTeller)
fServiceSave intTeller
End Function
Private Sub Command2_Click()
Me.Textnum = 2
CallOut Me.ActiveControl.Caption
Me.Txtno2 = txtNo
End Sub
Private Sub Command3_Click()
Me.Textnum = 3
CallOut Me.ActiveControl.Caption
Me.Txtno3 = txtNo
End Sub
Private Sub Command4_Click()
Me.Textnum = 4
CallOut Me.ActiveControl.Caption
Me.Txtno4 = txtNo
End Sub
Private Sub Command5_Click()
Me.Textnum = 5
CallOut Me.ActiveControl.Caption
Me.Txtno5 = txtNo
End Sub
Private Sub Command6_Click()
Me.Textnum = 6
CallOut Me.ActiveControl.Caption
Me.Txtno6 = txtNo
End Sub
Private Sub Command7_Click()
Me.Textnum = 7
CallOut Me.ActiveControl.Caption
Me.Txtno7 = txtNo
End Sub
Private Sub Command8_Click()
Me.Textnum = 8
CallOut Mid(Me.ActiveControl.Caption, 2)
Me.Txtno8 = txtNo
End Sub
Private Sub Command9_Click()
Me.Textnum = 9
CallOut Mid(Me.ActiveControl.Caption, 2)
Me.Txtno9 = txtNo
End Sub
Private Sub Form_Load()
Me.txtNo = 0
Me.Textnum = 0
Me.Txtno1 = 0
Me.Txtno2 = 0
Me.Txtno3 = 0
Me.Txtno4 = 0
Me.Txtno5 = 0
Me.Txtno6 = 0
Me.Txtno7 = 0
Me.Txtno8 = 0
Me.Txtno9 = 0
StatusBarMsg ("Edit By ÀÒ³ØÇѲ¹ì ¾ÃÁ¿Ù ·Õè·Ó¡ÒÃä»ÃɳÕÂì¨Ñ§ËÇÑ´¹èÒ¹ 054 710178 µèÍ 16")
ReSizeForm Me
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyA
If Me.Txtno1 = 0 Then
DoCmd.CancelEvent
Else
Call Command01_Click
End If
Case vbKeyF2
If Me.Txtno2 = 0 Then
DoCmd.CancelEvent
Else
Call Command02_Click
End If
Case vbKeyF3
If Me.Txtno3 = 0 Then
DoCmd.CancelEvent
Else
Call Command03_Click
End If
Case vbKeyF4
If Me.Txtno4 = 0 Then
DoCmd.CancelEvent
Else
Call Command04_Click
End If
Case vbKeyF5
If Me.Txtno5 = 0 Then
DoCmd.CancelEvent
Else
Call Command05_Click
End If
Case vbKeyF6
If Me.Txtno6 = 0 Then
DoCmd.CancelEvent
Else
Call Command06_Click
End If
Case vbKeyB
If Me.Txtno7 = 0 Then
DoCmd.CancelEvent
Else
DoCmd.SetWarnings False
Call Command07_Click
'Debug.Print "1"
End If
Case vbKeyF8
If Me.Txtno8 = 0 Then
DoCmd.CancelEvent
Else
Call Command08_Click
End If
Case vbKeyF9
If Me.Txtno9 = 0 Then
DoCmd.CancelEvent
Else
Call Command09_Click
End If
End Select
End Sub
Private Sub Command01_Click()
Me.Command1.SetFocus
CallOut1 Me.ActiveControl.Caption
End Sub
Function CallOut1(intTeller As Integer)
Me.Repaint
Call ReadOut(Me.Txtno1, intTeller)
End Function
Private Sub Command02_Click()
Me.Command2.SetFocus
CallOut2 Me.ActiveControl.Caption
End Sub
Function CallOut2(intTeller As Integer)
Me.Repaint
Call ReadOut(Me.Txtno2, intTeller)
End Function
Private Sub Command03_Click()
Me.Command3.SetFocus
CallOut3 Me.ActiveControl.Caption
End Sub
Function CallOut3(intTeller As Integer)
Me.Repaint
Call ReadOut(Me.Txtno3, intTeller)
End Function
Private Sub Command04_Click()
Me.Command4.SetFocus
CallOut4 Me.ActiveControl.Caption
End Sub
Function CallOut4(intTeller As Integer)
Me.Repaint
Call ReadOut(Me.Txtno4, intTeller)
End Function
Private Sub Command05_Click()
Me.Command5.SetFocus
CallOut5 Me.ActiveControl.Caption
End Sub
Function CallOut5(intTeller As Integer)
Me.Repaint
Call ReadOut(Me.Txtno5, intTeller)
End Function
Private Sub Command06_Click()
Me.Command6.SetFocus
CallOut6 Me.ActiveControl.Caption
End Sub
Function CallOut6(intTeller As Integer)
Me.Repaint
Call ReadOut(Me.Txtno6, intTeller)
End Function
Private Sub Command07_Click()
Me.Command7.SetFocus
CallOut7 Me.ActiveControl.Caption
End Sub
Function CallOut7(intTeller As Integer)
Me.Repaint
Call ReadOut(Me.Txtno7, intTeller)
End Function
Private Sub Command08_Click()
Me.command8.SetFocus
CallOut8 Mid(Me.ActiveControl.Caption, 2)
End Sub
Function CallOut8(intTeller As Integer)
Me.Repaint
Call ReadOut(Me.Txtno8, intTeller)
End Function
Private Sub Command09_Click()
Me.command9.SetFocus
CallOut9 Mid(Me.ActiveControl.Caption, 2)
End Sub
Function CallOut9(intTeller As Integer)
Me.Repaint
Call ReadOut(Me.Txtno9, intTeller)
End Function
'Private Sub Form_Timer()
' [Time] = Now()
'End Sub
ช่วยเเนะเเนวทางหน่อยนะค่ะ ขอบคุนมากๆค่ะ
|
 |
 |
 |
 |
Date :
2011-02-16 12:17:12 |
By :
thanthip |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้เปงโมดุล PlaySound
Option Explicit
#If Win32 Then
Public Const SND_ASYNC& = &H1
Public Const SND_SYNC& = &H0
#Else
Public Const SND_ASYNC% = &H1
Public Const SND_SYNC% = &H0
#End If
#If Win32 Then
Public Declare Function sndPlaySound& Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)
Public Declare Function mciExecute& Lib "winmm.dll" (ByVal lpstrCommand As String)
#Else
Public Declare Function sndPlaySound% Lib "mmsystem.dll" (ByVal lpszSoundName As String, ByVal uFlags As Integer)
Public Declare Function mciExecute% Lib "mmsystem.dll" (ByVal lpstrCommand As String)
#End If
Public Function PlaySound(PathToWavOrMidi$)
Dim lFlags As Long
Dim lPlay As Long
lFlags = SND_ASYNC& Or SND_SYNC& 'Returns to the begining of Wav or Midi
lPlay = sndPlaySound(PathToWavOrMidi$, 0) 'Plays the Wav or Midi Sound
End Function
Public Function PlaySound2(PathToWavOrMidi$)
Dim lPlay As Long
lPlay = mciExecute("Open " & PathToWavOrMidi$)
If lPlay = 0 Then
lPlay = mciExecute("Close")
End If
End Function
ดูไม่ออก งิ
|
 |
 |
 |
 |
Date :
2011-02-16 12:19:03 |
By :
thanthip |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
น้องชายงงตรงใหนอะ หรืองงทั้งหมด และอยากให้ช่วยทำอะรัยอะ comment ให้เราเข้าใจ หรือแก้ หรือมันมีเออเร่อ งั้นก้อส่งมาดูนะ
|
 |
 |
 |
 |
Date :
2011-02-16 16:17:06 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนนี้ รันได้เเล้ว เสียงออกเเล้ว ดีใจเปงที่สุด ขอบคุนมากๆ สำหรับทุกๆ ความช่วยเหลือ จ้า
ปิดกระทู้จ้า อิอิ
|
 |
 |
 |
 |
Date :
2011-02-16 21:19:39 |
By :
thanthip |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|