Click here to Skip to main content
12,952,398 members (39,957 online)
Rate this:
Please Sign up or sign in to 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:
Me.PictureBox1.Width += 200%
        Me.PictureBox1.Height += 150%

with this code i cant move up and down througth the image
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
Posted 20-Nov-12 9:35am
Updated 20-Nov-12 9:57am
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.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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(...))[^].


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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,239
CHill60 3,490
Maciej Los 3,083
Jochen Arndt 1,975
ppolymorphe 1,880

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100