On my Form I have a Top Panel, a Bottom Panel and a TableLayoutPanel between them, where the main information is displayed. When user clicks on one row in this TableLayoutPanel, the item is considered to be viewed and next items should slide one position forward (row 1 becomes row2, row2 becomes row3 and row3 gets new data). I want this slide action for the user to visualise the change.
Share
you will have to implement the needed painting yourself.
you could override
OnPaintand let all painting be handled by the originalOnPaintexcept when your sliding should happen…when your sliding happens, you could take a second
TableLayoutPanelthat is not present on your form, that contains all 4 rows (the old 3 rows + the new one) and draw that onto a bitmap image (Control.DrawToBitmap())now you have a bitmap that is larger than your sliding
TableLayoutPanel… now take that bitmap and use the desired part of it to get your sliding animation … instead of calling the originalOnPaint, you can take the desired region from the bitmap … you will of course have to calculate the desired region first, depending on the desired speed of your sliding animation, smoth start and stop, or whatever comes to your mind …