Click here to Skip to main content
11,572,828 members (66,308 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET PIC
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

http://www.kareprints.com/wp-content/uploads/2010/10/pan-detail.png
Posted 20-Nov-12 9:35am
iKsn213
Edited 20-Nov-12 9:57am
v2
Comments
Sergey Alexandrovich Kryukov at 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

Rate this: bad
good
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(...))[^].

—SA
  Permalink  

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

  Print Answers RSS


Advertise | Privacy | Mobile
Web04 | 2.8.150624.2 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2015
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