Create a scroll bar on the screen
Form View
Implementation:
1. Create a form, set the form formborderstyle to none, and set its transparencykey attribute to control.
2. Add the lable control and set the text attribute to scroll the string
3. Add the timer control and write code under its tick event
Code:
- // Move the lable control to the left
- This. lable1.left = This. lable1.left-3;
- // If the right side of the control is exposed to the left side of the container
- // Move from the right
- If (this. lable1.right <0)
- {
- This. lable1.left = This. width;
- }
4. In the form loading time, set the windowstate attribute of the form to maximized and start the timer control.
The above step completes the animation effect. In the above Code, we need to be familiar with the control. Left and
Control. RightThese two control attributes
System. Windows. Forms. Control. left:The distance between the left side of the control and the left side of the container.
System. Windows. Forms. Control. Right: the distance between the right side of the control and the left side of the container.
Tips to share with you
Happy in learning, happy in learning