Is it possible to run fake scrolling in WinForms?

Is it possible to run fake scrolling in WinForms?

Scenario: A
form with various drawings on it is executed using System.Drawing (and without scroll bars).

What I would like:

  • Prognostically inform that the user scrolled 10 pixels to the left.
  • The shape moves the existing drawing 10 pixels to the left.
  • The form generates a paint event with a ClipRectangle containing only the right 10 pixels, which are now empty.

Is this possible or do I need to handle this myself?

+3
source share
4 answers

, , . , VerticalScroll HorizontalScroll .

.

 this.panel1.VerticalScroll.Value = 50;
this.panel1.HorizontalScroll.Value = 100;
+3

, , , , .

, PictureBox, , , .

+1

, ..location = -10,0, . , . , . , .

+1

System.Drawing, (OnPaint() ), x -10 . , , .

10 , 10 . :

1) - = 10 . , Invalidate(). , , 10 . 2) , , . 10 . Invalidate 10 .

# 2, , , # 1. , , .

+1

Source: https://habr.com/ru/post/1707619/


All Articles