Kako bi bilo najlakše napraviti da kad se mišem pređe preko neke slike da se umjesto te pojavi neka druga i ponovo vrati stara slika kad se miš smakne sa te slike. Da pojednostavim evo primjera.
Mouse Move Slika i to...
Zaključano
Zakačeno
Evo slikovito:
pa kad se miš nanese na ovu sliku izgleda ovako
pa kad se miš smakne ponovo 
ali se mora uzeti u uobzir da može biti veoma dosta ovakvih slika te bi pojedinačno vraćanje dosta usporavalo program.
ali se mora uzeti u uobzir da može biti veoma dosta ovakvih slika te bi pojedinačno vraćanje dosta usporavalo program.
Potpis
===============kad pokazivač miša dođe na sliku=====================
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Picture = LoadPicture("putanja do slike2 i njeno ime s ekst)
im1=1
End Sub
============================================================
==================kad se pokazivač miša makne sa slike================
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Picture = LoadPicture("putanja do slike1 i njeno ime s ekst)
End Sub
=============================================================
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Picture = LoadPicture("putanja do slike2 i njeno ime s ekst)
im1=1
End Sub
============================================================
==================kad se pokazivač miša makne sa slike================
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Picture = LoadPicture("putanja do slike1 i njeno ime s ekst)
End Sub
=============================================================
Potpis
::RE5PECT::
offtopic ali... Ubuduće koristi CODE tagove.
urnebes nisi me dobro razumio. Ja mogu to da odradim ali šta ako imam na desetine takvih slika i to još jedna do druge, tako da ovo Form_MouseMove se neće izvršiti. Tako da ja mislim da bi trebalo kao što mi reče Željko izvršiti oprimizaciju koda ili napraviti neku f-ju da program nebi imao poteškoća sa radom.
Potpis
mozda da napravis array picture box-eva:
to bi trebalo da vrsi stvar, samo naravno normal() i over() moras da napunis sa putanjama do slika za svaki picbox. recimo
Picture1(0):
normal(0)=App.Path & "\gfx\button0_normal.bmp"
over(0)=App.Path & "\gfx\button0_overl.bmp"
Picture1(1):
normal(1)=App.Path & "\gfx\button1_normal.bmp"
over(1)=App.Path & "\gfx\button1_overl.bmp"
....
Pozdrav!
Code:
'prvo napravi dva string array-a:
Dim normal() As String
Dim over() As String
Sub Picture1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim k As Integer
For k=Picture1.LBound To Picture1.UBound
If k=Index Then
Picture1(k).Picture=LoadPicture(over(k))
Else
Picture1(k).Picture=LoadPicture(normal(k))
End If
Next
End Sub
'i takodje:
Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim k As Integer
For k=Picture1.LBound To Picture1.UBound
Picture1(k).Picture=LoadPicture(normal(k))
Next
End Sub
'prvo napravi dva string array-a:
Dim normal() As String
Dim over() As String
Sub Picture1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim k As Integer
For k=Picture1.LBound To Picture1.UBound
If k=Index Then
Picture1(k).Picture=LoadPicture(over(k))
Else
Picture1(k).Picture=LoadPicture(normal(k))
End If
Next
End Sub
'i takodje:
Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim k As Integer
For k=Picture1.LBound To Picture1.UBound
Picture1(k).Picture=LoadPicture(normal(k))
Next
End Sub
to bi trebalo da vrsi stvar, samo naravno normal() i over() moras da napunis sa putanjama do slika za svaki picbox. recimo
Picture1(0):
normal(0)=App.Path & "\gfx\button0_normal.bmp"
over(0)=App.Path & "\gfx\button0_overl.bmp"
Picture1(1):
normal(1)=App.Path & "\gfx\button1_normal.bmp"
over(1)=App.Path & "\gfx\button1_overl.bmp"
....
Pozdrav!
mislim da je ovo najjednostavnije:
image1 treba biti istih dimenzija kao i image2, mora biti na istom mjestu (jedan na drugom) i u opcijama kod Image1 visible mora biti na True, a Image2 visible na false. tako isto i za image3 i image4, image5 i image6, image7 i image8.......
CODE:
Dim v
Private Sub Form_Load()
v = 0
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case (v)
Case 1
Image2.Visible = False
Image1.Visible = True
v = 0
Case 2
Image4.Visible = False
Image3.Visible = True
v = 0
Case 3
Image6.Visible = False
Image5.Visible = True
v = 0
Case 4
Image8.Visible = False
Image7.Visible = True
v = 0
End Select
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = False
Image2.Visible = True
v = 1
End Sub
Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
v = 1
End Sub
Private Sub Image3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image3.Visible = False
Image4.Visible = True
v = 2
End Sub
Private Sub Image4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
v = 2
End Sub
Private Sub Image5_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image5.Visible = False
Image6.Visible = True
v = 3
End Sub
Private Sub Image6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
v = 3
End Sub
Private Sub Image7_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image7.Visible = False
Image8.Visible = True
v = 4
End Sub
Private Sub Image8_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
v = 4
End Sub
image1 treba biti istih dimenzija kao i image2, mora biti na istom mjestu (jedan na drugom) i u opcijama kod Image1 visible mora biti na True, a Image2 visible na false. tako isto i za image3 i image4, image5 i image6, image7 i image8.......
CODE:
Dim v
Private Sub Form_Load()
v = 0
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case (v)
Case 1
Image2.Visible = False
Image1.Visible = True
v = 0
Case 2
Image4.Visible = False
Image3.Visible = True
v = 0
Case 3
Image6.Visible = False
Image5.Visible = True
v = 0
Case 4
Image8.Visible = False
Image7.Visible = True
v = 0
End Select
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = False
Image2.Visible = True
v = 1
End Sub
Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
v = 1
End Sub
Private Sub Image3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image3.Visible = False
Image4.Visible = True
v = 2
End Sub
Private Sub Image4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
v = 2
End Sub
Private Sub Image5_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image5.Visible = False
Image6.Visible = True
v = 3
End Sub
Private Sub Image6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
v = 3
End Sub
Private Sub Image7_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image7.Visible = False
Image8.Visible = True
v = 4
End Sub
Private Sub Image8_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
v = 4
End Sub
Potpis
::RE5PECT::
onaj link neradi.
ovaj valda radi:
http://urnebes2.freesuperhost.com/uploads2/mouse%20move.rar
ovaj valda radi:
http://urnebes2.freesuperhost.com/uploads2/mouse%20move.rar
Potpis
::RE5PECT::
:D zasto jednostavno, kad moze slozeno?
zar ne?
zar ne?