หน้าแรก
 การบ้าน
  C/C++ new
  Java new
  Windows Phone
  แจ้งเรื่องที่ต้องการ
 บทความ
  .NET
  Android
  Blackberry
  C++Builder
  Delphi
  Java
  Mobile
  Open Source
  Pocket PC
  Visual Basic
  Web
  Windows Phone
  Others
 แบบเรียนฟรี
  ASP
  ASP.NET Webmatrix
  C++
  eVB
  J2ME
  Java
  PHP
 ซอร์สโค้ด
  Android
  ASP
  C++
  VC++
  CGI-Perl
  Delphi
  Java
  jQuery
  PHP
  Visual Basic
  .NET
 บริการจากเรา
  เปิดท้าย... ขายโค้ด
  Freeware
  อัตราค่าโฆษณา
  รายชื่อลูกค้า
  สถิติผู้เข้าเว็บ
 ดาว์นโหลด
 ค้นหาข้อมูล
 กระดานสนทนา
  .NET
  C/C++
  Delphi
  Java
  Palm/PocketPC
  Visual Basic
  Web
  อื่นๆ
 กระดานงาน
 ลิงค์เว็บ
 เกี่ยวกับผม
 อัตราค่าโฆษณา
Social Network

Facebook  Twitter  YouTube
 New Article
 Webboard
 Freelanceboard
Freeware
โปรแกรมเบอร์ดี (BerDee)
โปรแกรมเบอร์ดี (Android)
เกมส์เป่ายิ้งฉุบ
เกมส์เป่ายิ้งฉุบ(Android)
WebcamMonitor
WebcamMonitor(Windows)
scSendMail
scSendMail(Windows)
MSN Caption
MSN Caption(Windows)
  Freelance comment
  ติดต่อสอบถามมาได้ตลอดนะ...
2015-07-29 13:35:58
  ถ้าผมต้องการเว็บที่พัฒน...
2015-01-18 15:33:54
  ถ้าผมต้องการเว็บที่พัฒน...
2015-01-18 15:32:51
  ติดต่อสอบถามเข้ามาได้นะ...
2014-01-06 12:47:38
  ถ้ายังหาคนสอนไม่ได้ ก็ลอ...
2013-07-06 01:04:37
  สนใจส่งขอบเขตมาคุยราคาก...
2013-03-24 18:54:20
  ถ้ายังไม่มีคนรับงานติดต...
2012-12-16 19:18:14
  สนใจคะ ติดต่อ 0905076277...
2012-11-12 11:07:46
  รับทำโปรเจ็คนักศึกษาหรื...
2012-10-29 03:10:46
  sukit_te34@hotmail.com...
2012-10-29 03:09:36
  Webboard comment
  เขียนโปรแกรมภาษาจาวา
1.โ...

2023-09-12 11:40:28
  ต้องลอง debug ดูเองครับ
ไล่...

2023-06-08 18:03:06
  ร้านค้าแห่งหนึ่ง จะต้องน...
2021-09-21 08:47:08
  จงเขียนโปรแกรมดำเนินการ...
2021-05-07 15:06:11
  จงเขียนโปรแกรมสำหรับคำน...
2021-03-09 14:21:45
  ขอดู...
2021-01-04 23:56:45
  ขอโค้ดเพื่อทำการเรียนกา...
2020-12-09 23:02:09
  แล้ว ?...
2020-12-09 10:56:34
  จ้า...
2020-10-18 16:53:21
  พอดีผมเหลื่อแค่ตัดสต๊อก...
2020-05-31 21:49:43
  Homework comment
  เขียนโปรแกรมเพื่อรับค่า...
2022-02-24 10:45:17
  จากโค้ดนี้อะครับ พอดีลอง...
2021-03-22 01:22:39
  จากโค้ดนี้อะครับ พอดีลอง...
2021-03-22 01:22:39
  โจทย์การบ้าน c++ เขียนรูปแ...
2020-04-06 11:01:33
  แบบนี้ขอเป็น ภาษา php หน่อย...
2019-09-18 14:36:34
  ผมไม่อยากให้คุณได้คะแนน...
2019-04-27 01:29:07
  อาจารย์เขาบอกแนวข้อสอบม...
2019-04-27 00:44:29
  ขอสอบถามการเขียน c++ ครับ เ...
2018-04-02 12:19:21
  โค้ดตัวอย่างศึกษาให้เข้...
2017-11-26 14:50:05
  คำนวณค่าน้ำโดยรับค่ามิเ...
2017-11-20 23:15:26
  Article comment
  เท่าที่อ่าน error คือพื้นที่...
2022-03-23 13:56:48
  เรียน สอบถามปัญหา กับ อ.คร...
2022-01-24 17:39:49
  ต้องการ ให้เขียน โปรแกรม ...
2019-12-09 11:39:58
  รับเขียน arx จาก vc++ 2017 ล็อคโปร...
2019-09-19 09:48:09
  ทำการ register ไฟล์ที่ชื่อ mswinsck.oc...
2019-09-17 14:05:56
  ใน vb 6 ไม่มี component winsock เลยค่ะ ส...
2019-09-03 10:31:02
  รบกวนขอสอบถามหน่อยนะครั...
2019-03-04 05:31:04
  สามารถนำตัวหนังสือจากภา...
2018-12-25 08:54:32
  มีcode ของ VB ไหมค่ะ ถ้ามีรบกว...
2017-09-28 16:50:02
  น่าจะได้ครับ ไม่เคยลอง
...

2017-07-11 09:59:35
  9Mcode comment

Link Exchange

อัตราค่าโฆษณา
 
 Webboard

- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -

กระทู้ #3321 [Vb] (จาก IP: 118.172.109.17)

vb6 รบกวนดูโค้ดทอยลูกเต๋า ทีค่ะ

จากโค้ดนี้อ่ะค่ะ มันทำได้แค่สุ่มเลขสูงต่ำค่ะอยากใส่แบบค่าเงินได้ด้วยอะค่ะ เริ่มเงินให้100เล่นตาละ10เงินหมดจะออกจากเกมอะค่ะ


Private Sub Form1_Load()
End Sub
Option Explicit
Dim simbol As Integer

Private Sub Command1_Click()
If Option1.Value = False And Option2.Value = False And Option3.Value = False Then
MsgBox "กรุณาเลือก สูง กลาง ต่ำ ", vbInformation
End If
Randomize
Timer1.Enabled = True
Command1.Enabled = False
Command2.Enabled = True
Do While Timer1.Enabled
DoEvents
Timer1_Timer
Loop
End Sub

Private Sub Command2_Click()
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Me.Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
Timer1.Interval = 1000
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
End Sub

Private Sub Timer1_Timer()
Label1 = Int(Rnd() * 6) + 1
Label2 = Int(Rnd() * 6) + 1
Label3 = Int(Rnd() * 6) + 1
Text1.Text = Int(Label1) + Int(Label2) + Int(Label3)
Select Case True
Case Option1.Value = True
If Int(Text1.Text) > 11 Then
Text2.Text = "ถูก"
Else
Text2.Text = "ผิด"
End If
Case Option2.Value = True
If Int(Text1.Text) = 11 Then
Text2.Text = "ถูก"
Else
Text2.Text = "ผิด"
End If
Case Option3.Value = True
If Int(Text1.Text) < 11 Then
Text2.Text = "ถูก"
Else
Text2.Text = "ผิด"
End If
End Select
End Sub
จากคุณ : aom / aom_hookang@hotmail.com [2012-07-09 19:24:22]  

101.108.25.138 ความคิดเห็น #28651 (จาก IP: 101.108.25.138)
เอาหลักการไปศึกษาเองดีกว่า ให้คนอื่นเขียนให้มันได้งานส่ง แต่มันไม่ได้คิด
เริ่ม
1.ศึกษากระบวนการของโค้ดที่ได้มา ว่าแต่ละบรรทัดทำเพื่ออะไร มีลำดับการทำงานจากไหนไปไหน และทำอย่างไร
2.ประกาศตัวแปรเก็บเงิน ไว้ 1 ตัว (ควรจะเป็น ตัวแปรจำนวนเต็ม)
3.หาตำแหน่งที่จะวางโค้ดเข้าไปว่า เล่นชนะเพิ่มเงิน เล่นแพ้ลบเงิน เหลือเงินเท่าไหร่อาจนำไปเข้าเงื่อนไขอีกว่าจะจบเกมส์เลยหรือเปล่า
จากคุณ : การเขียนโปรแกรมเป็นทักษะถ้าไม่ขยันก็ไม่เป็น [2012-07-10 00:47:21]

118.172.109.17 ความคิดเห็น #28652 (จาก IP: 118.172.109.17)
ลองทำแล้วมันได้แค่นี้ จิงๆ
จากคุณ : aom / aom_hookang@hotmail.com [2012-07-10 03:34:56]

101.108.6.211 ความคิดเห็น #28653 (จาก IP: 101.108.6.211)
ถ้าโค้ดด้านบนคุณเขียนเองจริงๆ การที่เพิ่มตัวแปรและทำเพิ่มมันง่ายๆมากๆครับ
จากคุณ : การเขียนโปรแกรมเป็นทักษะถ้าไม่ขยันก็ไม่เป็น [2012-07-10 21:34:01]

223.204.12.188 ความคิดเห็น #28654 (จาก IP: 223.204.12.188)
นำโค้ดไปวางใน Notepad และบันทึกเป็น
นามสกุลเป็น .FRM


VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 2745
ClientLeft = 45
ClientTop = 330
ClientWidth = 5970
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2745
ScaleWidth = 5970
StartUpPosition = 3 'Windows Default
Begin VB.Frame Frame3
Caption = "Frame3"
Height = 2535
Left = 3480
TabIndex = 19
Top = 120
Width = 2415
End
Begin VB.TextBox Text4
Height = 285
Left = 2520
TabIndex = 18
Text = "Text4"
Top = 2250
Width = 855
End
Begin VB.Frame Frame2
Caption = "เต็งเลข"
Height = 1815
Left = 2520
TabIndex = 11
Top = 120
Width = 855
Begin VB.OptionButton Teng6
Caption = "6"
Height = 255
Left = 120
TabIndex = 17
Top = 1440
Width = 615
End
Begin VB.OptionButton Teng5
Caption = "5"
Height = 255
Left = 120
TabIndex = 16
Top = 1200
Width = 615
End
Begin VB.OptionButton Teng4
Caption = "4"
Height = 255
Left = 120
TabIndex = 15
Top = 960
Width = 615
End
Begin VB.OptionButton Teng3
Caption = "3"
Height = 255
Left = 120
TabIndex = 14
Top = 720
Width = 615
End
Begin VB.OptionButton Teng2
Caption = "2"
Height = 255
Left = 120
TabIndex = 13
Top = 480
Width = 615
End
Begin VB.OptionButton Teng1
Caption = "1"
Height = 255
Left = 120
TabIndex = 12
Top = 240
Width = 615
End
End
Begin VB.Frame Frame1
Caption = "แทง สูง/ต่ำ"
Height = 1095
Left = 120
TabIndex = 8
Top = 120
Width = 1335
Begin VB.OptionButton Option1
Caption = "สูง"
Height = 375
Left = 120
TabIndex = 10
Top = 240
Width = 975
End
Begin VB.OptionButton Option2
Caption = "ต่ำ"
Height = 375
Left = 120
TabIndex = 9
Top = 600
Width = 975
End
End
Begin VB.TextBox Text3
Height = 285
Left = 2520
TabIndex = 4
Text = "Text3"
Top = 1920
Width = 855
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 222
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 1560
TabIndex = 3
Text = "Text2"
Top = 240
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 2
Text = "Text1"
Top = 720
Width = 855
End
Begin VB.CommandButton Command2
Caption = "เปิด"
BeginProperty Font
Name = "MS Sans Serif"
Size = 14.25
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 1080
TabIndex = 1
Top = 1920
Width = 975
End
Begin VB.CommandButton Command1
Caption = "ทอย"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 0
Top = 1920
Width = 975
End
Begin VB.Timer Timer1
Left = 2040
Top = 2160
End
Begin VB.Label Label3
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "X"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1560
TabIndex = 7
Top = 1320
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "X"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 6
Top = 1320
Width = 615
End
Begin VB.Label Label1
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "X"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 5
Top = 1320
Width = 615
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form1_Load()
End Sub
Option Explicit
Dim simbol As Integer

Private Sub Command1_Click()
If Option1.Value = False And Option2.Value = False Then
MsgBox "กรุณาเลือก สูง ต่ำ ", vbInformation
End If
Randomize
Timer1.Enabled = True
Command1.Enabled = False
Command2.Enabled = True
Do While Timer1.Enabled
DoEvents
Timer1_Timer
Loop
End Sub

Private Sub Command2_Click()
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
Select Case True
Case Option1.Value = True
If Int(Text1.Text) >= 11 Then
Text2.Text = "ถูก"
Else
Text2.Text = "ผิด"
End If
Case Option2.Value = True
If Int(Text1.Text) < 11 Then
Text2.Text = "ถูก"
Else
Text2.Text = "ผิด"
End If
End Select
Select Case True
Case Teng1.Value = True
Text3.Text = IIf(Label1.Caption = 1, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 1, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 1, 1, 0)
Case Teng2.Value = True
Text3.Text = IIf(Label1.Caption = 2, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 2, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 2, 1, 0)
Case Teng3.Value = True
Text3.Text = IIf(Label1.Caption = 3, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 3, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 3, 1, 0)
Case Teng4.Value = True
Text3.Text = IIf(Label1.Caption = 4, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 4, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 4, 1, 0)
Case Teng5.Value = True
Text3.Text = IIf(Label1.Caption = 5, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 5, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 5, 1, 0)
Case Teng6.Value = True
Text3.Text = IIf(Label1.Caption = 6, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 6, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 6, 1, 0)
End Select
If Text3.Text = 0 Then
Text4.Text = Text4.Text - 10
If Text4.Text <= 0 Then MsgBox "Game Over": End
Else
Text4.Text = Text4.Text + (Text3.Text * 10)
MsgBox "เต็งถูก"
End If
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Me.Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
Timer1.Interval = 1000
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
Text3.Text = 0
Text4.Text = 100
Option1.Value = True
Teng1.Value = True
End Sub

Private Sub Timer1_Timer()
Label1.Caption = Int(Rnd() * 6) + 1
Label2.Caption = Int(Rnd() * 6) + 1
Label3.Caption = Int(Rnd() * 6) + 1
Text1.Text = Int(Label1) + Int(Label2) + Int(Label3)
End Sub
จากคุณ : แคทอาย / patomchet@hotmail.com [2012-07-13 13:16:03]

223.204.12.188 ความคิดเห็น #28655 (จาก IP: 223.204.12.188)
เอาใหม่...ของน้อง...ขอบอกว่า...เขียนโปรแกรม
แบบเอาตัวแปร...ใส่ไว้ในโค้ด...เช่นตัวถ่วงเวลา
ซึ่งกำหนดผ่านโค้ด...ทำให้โปรแกรมของพี่ทำงาน
แบบตัวอย่างไม่ได้...และใส่ Loop ให้ Timer
อีก...ซึ่งมันไม่ต้องใส่...อ่ะ...เอาไปใหม่...

คัดลอกลง Notepad และบันทึกในนามสกุล .FRM


VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 2745
ClientLeft = 45
ClientTop = 330
ClientWidth = 5970
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2745
ScaleWidth = 5970
StartUpPosition = 3 'Windows Default
Begin VB.Frame Frame3
Caption = "Frame3"
Height = 2535
Left = 3480
TabIndex = 19
Top = 120
Width = 2415
End
Begin VB.TextBox Text4
Height = 285
Left = 2520
TabIndex = 18
Text = "Text4"
Top = 2250
Width = 855
End
Begin VB.Frame Frame2
Caption = "เต็งเลข"
Height = 1815
Left = 2520
TabIndex = 11
Top = 120
Width = 855
Begin VB.OptionButton Teng6
Caption = "6"
Height = 255
Left = 120
TabIndex = 17
Top = 1440
Width = 615
End
Begin VB.OptionButton Teng5
Caption = "5"
Height = 255
Left = 120
TabIndex = 16
Top = 1200
Width = 615
End
Begin VB.OptionButton Teng4
Caption = "4"
Height = 255
Left = 120
TabIndex = 15
Top = 960
Width = 615
End
Begin VB.OptionButton Teng3
Caption = "3"
Height = 255
Left = 120
TabIndex = 14
Top = 720
Width = 615
End
Begin VB.OptionButton Teng2
Caption = "2"
Height = 255
Left = 120
TabIndex = 13
Top = 480
Width = 615
End
Begin VB.OptionButton Teng1
Caption = "1"
Height = 255
Left = 120
TabIndex = 12
Top = 240
Width = 615
End
End
Begin VB.Frame Frame1
Caption = "แทง สูง/ต่ำ"
Height = 1095
Left = 120
TabIndex = 8
Top = 120
Width = 1335
Begin VB.OptionButton Option1
Caption = "สูง"
Height = 375
Left = 120
TabIndex = 10
Top = 240
Width = 975
End
Begin VB.OptionButton Option2
Caption = "ต่ำ"
Height = 375
Left = 120
TabIndex = 9
Top = 600
Width = 975
End
End
Begin VB.TextBox Text3
Height = 285
Left = 2520
TabIndex = 4
Text = "Text3"
Top = 1920
Width = 855
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 222
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 1560
TabIndex = 3
Text = "Text2"
Top = 240
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 2
Text = "Text1"
Top = 720
Width = 855
End
Begin VB.CommandButton Command2
Caption = "เปิด"
BeginProperty Font
Name = "MS Sans Serif"
Size = 14.25
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 1080
TabIndex = 1
Top = 1920
Width = 975
End
Begin VB.CommandButton Command1
Caption = "ทอย"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 0
Top = 1920
Width = 975
End
Begin VB.Timer Timer1
Interval = 10
Left = 2040
Top = 2040
End
Begin VB.Label Label3
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "0"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1560
TabIndex = 7
Top = 1320
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "0"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 6
Top = 1320
Width = 615
End
Begin VB.Label Label1
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "0"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 222
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 5
Top = 1320
Width = 615
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form1_Load()
End Sub
Option Explicit
Dim simbol As Integer

Private Sub Command1_Click()
If Option1.Value = False And Option2.Value = False Then
MsgBox "กรุณาเลือก สูง ต่ำ ", vbInformation
End If
Randomize
Timer1.Enabled = True
Command1.Enabled = False
Command2.Enabled = True
End Sub

Private Sub Command2_Click()
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
Text3.Text = 0
Select Case True
Case Teng1.Value = True
Text3.Text = IIf(Label1.Caption = 1, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 1, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 1, 1, 0)
Case Teng2.Value = True
Text3.Text = IIf(Label1.Caption = 2, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 2, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 2, 1, 0)
Case Teng3.Value = True
Text3.Text = IIf(Label1.Caption = 3, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 3, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 3, 1, 0)
Case Teng4.Value = True
Text3.Text = IIf(Label1.Caption = 4, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 4, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 4, 1, 0)
Case Teng5.Value = True
Text3.Text = IIf(Label1.Caption = 5, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 5, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 5, 1, 0)
Case Teng6.Value = True
Text3.Text = IIf(Label1.Caption = 6, 1, 0)
Text3.Text = Text3.Text + IIf(Label2.Caption = 6, 1, 0)
Text3.Text = Text3.Text + IIf(Label3.Caption = 6, 1, 0)
End Select
If Text3.Text = 0 Then
Text4.Text = Text4.Text - 10
If Text4.Text <= 0 Then MsgBox "Game Over": End
Else
Text4.Text = Text4.Text + (Text3.Text * 10)
MsgBox "เต็งถูก"
End If
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Me.Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
Text4.Text = 100
Option1.Value = True
Teng1.Value = True
End Sub

Private Sub Timer1_Timer()
Label1.Caption = Trim(Str(Int(Rnd() * 6) + 1))
Label2.Caption = Trim(Str(Int(Rnd() * 6) + 1))
Label3.Caption = Trim(Str(Int(Rnd() * 6) + 1))
Text1.Text = Int(Label1) + Int(Label2) + Int(Label3)
Select Case True
Case Option1.Value = True
If Int(Text1.Text) >= 11 Then
Text2.Text = "ถูก"
Else
Text2.Text = "ผิด"
End If
Case Option2.Value = True
If Int(Text1.Text) < 11 Then
Text2.Text = "ถูก"
Else
Text2.Text = "ผิด"
End If
End Select

End Sub
จากคุณ : แคทอาย / patomchet@hotmail.com [2012-07-13 13:56:38]

223.204.12.188 ความคิดเห็น #28656 (จาก IP: 223.204.12.188)
555 นึก...ว่า...เป็นที่ Timer ที่แท้....
มันไม่ง่ายอย่างที่คิด แฮะ....เงื่อนไขการ เต็ง
เปลี่ยนคำสั่ง command2 เป็น ตัวนี้...
อัลกอลิทึม....ยากกว่าที่คิด แฮะ....


Private Sub Command2_Click()
Dim Teng As Integer
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
Select Case True
Case Teng1.Value = True
Teng = 1
Case Teng2.Value = True
Teng = 2
Case Teng3.Value = True
Teng = 3
Case Teng4.Value = True
Teng = 4
Case Teng5.Value = True
Teng = 5
Case Teng6.Value = True
Teng = 6
End Select

If Label1.Caption = Teng And Label1.Caption = Label2.Caption And _
Label2.Caption = Label3.Caption Then
Text3.Text = 3
ElseIf Label1.Caption = Teng And Label2.Caption = Teng Or _
Label1.Caption = Teng And Label3.Caption = Teng Or _
Label2.Caption = Teng And Label3.Caption = Teng Then
Text3.Text = 2
ElseIf Label1.Caption = Teng Or Label2.Caption = Teng Or Label3.Caption = Teng Then
Text3.Text = 1
Else
Text3.Text = 0
End If

If Text3.Text = 0 Then
Text4.Text = Text4.Text - 10
If Text4.Text <= 0 Then MsgBox "Game Over": End
Else
Text4.Text = Text4.Text + (Text3.Text * 10)
MsgBox "àµçÙ¡"
End If
End Sub
จากคุณ : แคทอาย / patomchet@hotmail.com [2012-07-13 14:23:59]

118.172.98.89 ความคิดเห็น #28657 (จาก IP: 118.172.98.89)
ขอบคุณทุกกระทู้ที่มาตอบให้มากมายค่ะ
จากคุณ : aom / aom_hookang@hotmail.com [2012-07-13 17:19:40]
ตอบกระทู้
  • ห้ามการโฆษณา หากต้องการติดต่อหาลูกค้า ติดต่อโฆษณาโดยตรงได้ที่ webmaster@sourcecode.in.th
  • ห้ามใช้คำหยาบและคำพูดที่ไม่เหมาะสม
  • ขอสงวนสิทธิหากตรวจพบ ข้อความที่ไม่เหมาะสม ข้อความนั้นจะถูกลบทันที
ชื่อ
อีเมล์
รายละเอียด

- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -

 
 
คลิปสอนเขียนโปรแกรม
เรียนเขียนโปรแกรมดอทเน็ต
เรียนเขียนโปรแกรมแอนดรอยด์
เรียนเขียนโปรแกรมเบล็คเบอร์รี่
เรียนเขียนโปรแกรมซี ซีพลัสพลัส
เรียนเขียนโปรแกรมจาวา
เรียนการใช้งานลินุกส์
เรียนการเขียนโปรแกรมวินโดว์โฟน
เรียนการเขียนโปรแกรมพีเฮชพี มายเอสคิวเอล
อัตราค่าโฆษณา
 
Tutorial
eVB Tutorial
ASP.NET Webmatrix Tutorial
J2ME Tutorial
C++  Tutorial
Java  Tutorial
PHP Tutorial
ASP Tutorial
 
แบบสำรวจ

Home - Article - Tutorial - Sourcecode - Dev Handbook - Search - WebBoard - Links - About Us

สงวนลิขสิทธิ์ ห้ามคัดลอก ทำซ้ำ แก้ไข ดัดแปลง ไม่ว่าในรูปแบบใด โดยไม่ได้รับอนุญาตเป็นลายลักษณ์อักษร
เลขทะเบียนพาณิชย์อิเล็กทรอนิกส์จากกระทรวงพาณิชย์: 7100503002000
Copyright 2001 SourceCode.in.th