Winforms: Creating Dynamic Timeline Management

I need to create a winforms control that looks something like this:

alt text I am currently considering making photoshop / panel and redefining the onpaint event and drawing all things by myself. But for some reason this approach seems wrong.

I was wondering, maybe there is a simpler way out, or perhaps a better solution? How would you do that control?

+4
source share
3 answers

No, this is the right way to do this. Trying to use something like TableLayoutPanel is not only excruciatingly painful, but also sucks off serious dirt, taking up a second or more paint. It takes a bunch of code, but it's not hard code. Lots of loop options.

Get scrolling using the AutoScrollMinSize panel. Use Graphics.TranslateTransform (), passing an AutoScrollPosition in a Paint or OnPaint event. The latter is recommended, get your own control from the panel to save the code separately. You have a lot of flexibility to customize the look, have some fun.

+3
source

The last time I did something like this, I made a grid in the form of a raster image, uploaded the image to the window with the picture, and drew it directly on the image. The problem with using the paint event is unstable when minimizing, etc., if you don't redo it.

+1
source

It would probably be easier to override the literal control or inherit from the CompositeControl class and then render it using HTML (tables) and Javascript, as opposed to drawing it.

0
source

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


All Articles