我有一個Windows Mobile應用程序。在該應用程序中,我有一個ScrollViewer,它允許用戶輕鬆瀏覽滾動條內的多個圖像。在這種情況下,他們是字母表的圖像。Windows Mobile - ScrollViewer
的問題是,我想邏輯代碼執行時的圖像上的用戶點擊,但是,如果通過點擊字母用戶滾動,它致動代碼....
例如,imageA有一個LeftClickButton事件,但是...如果用戶通過觸摸字母A來滾動... imgA_LeftClick中的邏輯代碼觸發。
我該如何解決這個問題?以下是我的代碼。
<ScrollViewer Height="98" Name="scrollerButtons" Width="603" Canvas.Left="40" Canvas.Top="383" VerticalAlignment="Center" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Visible">
<StackPanel Name="stackPanelButtons" Orientation="Horizontal" Canvas.Left="162" Canvas.Top="43" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Height="60" Name="imgA" Source="a.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgK" Source="k.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgM" Source="m.png" Stretch="Fill" Width="60" MouseLeftButtonDown="imgM_MouseLeftButtonDown"></Image>
<Image Height="60" Name="imgJ" Source="j.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgN" Source="n.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgO" Source="o.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgI" Source="i.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgH" Source="h.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgG" Source="g.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgF" Source="f.png" Stretch="Fill" Width="60" MouseLeftButtonDown="imgF_MouseLeftButtonDown"></Image>
<Image Height="60" Name="imgE" Source="e.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgD" Source="d.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgC" Source="c.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgB" Source="b.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgL" Source="l.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgT" Source="t.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgS" Source="s.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgR" Source="r.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgQ" Source="q.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgP" Source="p.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgU" Source="u.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgZ" Source="z.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgV" Source="v.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgW" Source="w.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgY" Source="y.png" Stretch="Fill" Width="60"></Image>
<Image Height="60" Name="imgX" Source="x.png" Stretch="Fill" Width="60"></Image>
</StackPanel>
</ScrollViewer>
我只是想要禮貌.... – Subby 2012-01-18 20:11:35