I would like to write an application in C++ that can pan image when user hold and move the mouse. I used a Panel and put a pictureBox on it. The property AutoScroll of the Panel is set to true. Now I am trying to change the position of the scroll bar when the mouse move. I tried a few methods but it does not work.
For simplicity, I use +/-100, +/-100 for codes here. I tried
Point p = new Point(100, 100);
panel1->AutoScrollPosition = p;
It gives me the following error:
cannot convert from 'System::Drawing::Point *' to 'System::Drawing::Point'"
I also tried the following.
panel1->AutoScrollPosition.X = 100;
panel1->AutoScrollPosition.Y = 100;
However, the scrollbar does not move and always return 0,0. I have tried using both -ve and +ve values but it's just not working.
How can I solve this problem?