Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi comunity, i've been started a image viewer project, the application must show a spesific photo linked to a part number and show information about the Part number.

DB: MS Access 2007
Source Code: VB.NET 2005

The picture is set in a PictureBox, the picture Box is set into a Split Panel (Panel2), Zoom Button, Reset Button, Search Button,etc works.

Zoom code:
VB
Me.PictureBox1.Width += 200%
        Me.PictureBox1.Height += 150%



with this code i cant move up and down througth the image
VB
Private Sub SplitContainer1_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles SplitContainer1.MouseWheel
    Dim myView As Point = Me.SplitContainer1.Panel2.AutoScrollPosition
    myView.X = (myView.X + 50)
    myView.Y = (myView.Y + 50)
    Me.SplitContainer1.Panel2.AutoScrollPosition = myView



But now i want move througt image with left click, like when the mouse looks like Pan hand

http://www.kareprints.com/wp-content/uploads/2010/10/pan-detail.png
Posted
Updated 20-Nov-12 9:57am
v2
Comments
Sergey Alexandrovich Kryukov 20-Nov-12 15:49pm    
Why using PictureBox? This is the problem. For any advanced features, you need your own control, not PictureBox, which does not help you at all, only adds hassles.
--SA

1 solution

Please see my comment. You don't need to use PictureBox. Instead of helping you, it only eats up some resources, performance and development time. It is really designed only for simplest cases. Even though you can achieve results with this control, you loose, not gain. I'll tell your what to do instead. Please see my past answers:
How do I clear a panel from old drawing[^],
draw a rectangle in C#[^],
Append a picture within picturebox[^].

And also:
Drawing Lines between mdi child forms[^],
capture the drawing on a panel[^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900