PDA

View Full Version : ساخت آدمک خندان و ناراحت با رویدادهای موس!



ahang_ziba
سه شنبه 03 فروردین 1389, 00:04 صبح
سلام به همگی:لبخندساده:

من میخوام با استفاده از رویدادهای موس برنامه ای بنویسم که وقتی برنامه رو اجرا میکنی صورت آدمک عادی باشه (نه خندان و نه ناراحت ) وقتی روش کلیک چپ کنی خندان بشه و وقتی کلیک راست کنی ناراحت بشه (شکل آدمکها با استفاده از paint ساخته میشن(فقط سر) )

کسی میتونه منو راهنمایی کنه؟

با تشکر

saeedvir
سه شنبه 03 فروردین 1389, 10:14 صبح
بفرما

مشکلی بود مطرح کنید

moh3en_f1
سه شنبه 03 فروردین 1389, 10:40 صبح
اینم اصلاح شده کد دوستمون




Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Picture1.Visible = 0
Picture2.Visible = 1
Picture3.Visible = 0
End If
If Button = 2 Then
Picture1.Visible = 0
Picture2.Visible = 0
Picture3.Visible = 1
End If
End Sub
Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Picture1.Visible = 0
Picture2.Visible = 1
Picture3.Visible = 0
End If
If Button = 2 Then
Picture1.Visible = 0
Picture2.Visible = 0
Picture3.Visible = 1
End If
End Sub
Private Sub Picture3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Picture1.Visible = 0
Picture2.Visible = 1
Picture3.Visible = 0
End If
If Button = 2 Then
Picture1.Visible = 0
Picture2.Visible = 0
Picture3.Visible = 1
End If
End Sub