PDA

نسخه کامل مشاهده نسخه کامل : ;کمک این برنامه رو یکی واسم کامل کنه سه چهر خط کد بیشتر نیست



garibashena
27-06-2008, 15:51
سلام دوستان من خودم چند تا برنامه نوشتم فکر کنم از صبح ساعت 8 تا خود الان پای سیستم هستم دیگه دارم هنگ می کنم :41: یکی این برنامرو واسم کامل کنه احتیاجش دارم :10:
سه تا image روی فرم باشه و هر 10 ثانیه یه بار image غیر فعل بشه و image بعدی جایگزین بشه

[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]


Dim start As Boolean
Dim time As Byte
Dim msg As Integer
Dim x As Byte
Private Sub Command1_Click()
start = True
If Command1.Caption = "stop" Then
start = False
Command1.Caption = "start"
End If
End Sub

Private Sub Command2_Click()
CommonDialog1.ShowOpen
Image1(x).Picture = LoadPicture(CommonDialog1.FileName)
x = x + 1
If x > 2 Then x = 0
Image1(x).Picture = LoadPicture(CommonDialog1.FileName)
End Sub
Private Sub Form_Load()
time = 30
start = False
x = 0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 58) And (KeyAscii <> 8 And KeyAscii <> 13) Then KeyAscii = 0
If KeyAscii = 13 Then
start = True
Timer1.Interval = Text1.Text
End If
End Sub

Private Sub Timer1_Timer()
If start = True Then
Command1.Caption = "stop"
time = time - 1
Label1.Caption = time

If time = 0 Then
start = False
msg = MsgBox("end time other game", vbYesNo)
If msg = vbYes Then
time = 30
Label1.Caption = 30
Else
start = False
End If
End If
End If

End Sub

garibashena
27-06-2008, 17:45
دوستان برنامه رو نوشتم ولی اگه یکی می تونه ساده تر و روان تر اینو بنویسه


Dim start As Boolean
Dim time As Byte
Dim msg As Integer
Dim x As Byte
Private Sub Command1_Click()
start = True
If Command1.Caption = "stop" Then
start = False
Command1.Caption = "start"
End If
End Sub

Private Sub Command2_Click()
CommonDialog1.ShowOpen
Image1(0).Picture = LoadPicture(CommonDialog1.FileName)
CommonDialog1.ShowOpen
Image1(1).Picture = LoadPicture(CommonDialog1.FileName)
CommonDialog1.ShowOpen
Image1(2).Picture = LoadPicture(CommonDialog1.FileName)
End Sub
Private Sub Form_Load()
time = 30
start = False
x = 0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 58) And (KeyAscii <> 8 And KeyAscii <> 13) Then KeyAscii = 0
If KeyAscii = 13 Then
start = True
Timer1.Interval = Text1.Text
End If
End Sub

Private Sub Timer1_Timer()
If time = 0 Then
For i = 0 To 2
Image1(i).Visible = True
Next
End If

If start = True Then

If time > 20 Then
Image1(0).Visible = True
Image1(1).Visible = False
Image1(2).Visible = False
End If
If (time > 10 And time < 20) Then
Image1(0).Visible = False
Image1(1).Visible = True
Image1(2).Visible = False
End If
If (time > 0 And time < 10) Then
Image1(0).Visible = False
Image1(1).Visible = False
Image1(2).Visible = True
End If


Command1.Caption = "stop"
time = time - 1
Label1.Caption = time

If time = 0 Then
start = False
msg = MsgBox("end time other game", vbYesNo)
If msg = vbYes Then
time = 30
Label1.Caption = 30
Else
start = False
End If
End If
End If

End Sub

armin_mx
30-06-2008, 21:55
اینو قبلا نوشته بودم میره آخرین عکس بر میگرده.

Dim i As Integer
Dim c As Integer
Private Sub Command1_Click()
If i = 3 Then GoTo 200
Image1(i).Visible = False
i = i + 1
Image1(i).Visible = True
If i < 4 Then GoTo 100
200:
Image1(c).Visible = False
c = c - 1
Image1(c).Visible = True
If c = 0 Then
c = 3
i = 0
End If
100:
End Sub

Private Sub Form_Load()
c = Image1.UBound
End Sub