c#如何实现会移动的文字效果

  介绍

这篇文章主要介绍了c#如何实现会移动的文字效果,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获、下面让小编带着大家一起了解一下。

c#实现会移动的文字效果的具体内容如下

1题目描述

中(1)Form1窗体设计界面如下:

 C #如何实现会移动的文字效果

(2)窗体左侧为一个靠左停靠的面板,其中包含一个标签控件;
(3)初试状态时,“水平移动”选中,当用户单击“开始移动”按钮时,标签在面板中水平从左向右移动,单击“暂停移动”按钮时,标签停在原位置不动;
标签(4)在移动过程中,若用户切换移动方式,则弹出对话框,提示先暂停移动;在标签暂停移动时,用户切换移动方式,标签在原位置以新的移动方式进行移动;

2源码详解

using 系统;   using  System.Collections.Generic;   using  System.ComponentModel;   using  System.Data;   using  System.Drawing;   using 来;   using 包含;   using  System.Windows.Forms;      namespace  Csharp7_2   {   ,,,public  partial  class  Form1 :形式   ,,,{   ,,,,,,,static  int  x =, 0;   ,,,,,,,static  int  y =, 0;   ,,,,,,,static  int  flag =, 0;   ,,,,,,,static  int  v =, 0;   ,,,,,,,static  int  h =, 0;   ,,,,,,,中public  Form1 ()   ,,,,,,,{   ,,,,,,,,,,,InitializeComponent ();   ,,,,,,,}      ,,,,,,,private  void  timer1_Tick (object ,发送方,EventArgs  e)   ,,,,,,,{   ,,,,,,,,,,,if  (radioButton1.Checked ,,, flag ==, 1)   ,,,,,,,,,,,{   ,,,,,,,,,,,,,,,if (时间+ label1.Location.X  label1.Size.Width 祝辞=,(时间+ panel1.Location.X  panel1.Size.Width))   ,,,,,,,,,,,,,,,{   ,,,,,,,,,,,,,,,,,,,v =, 1;   ,,,,,,,,,,,,,,,}   ,,,,,,,,,,,,,,,if  (label1.Location.X  & lt;, panel1.Location.X)   ,,,,,,,,,,,,,,,{   ,,,,,,,,,,,,,,,,,,,v =, 0;   ,,,,,,,,,,,,,,,}   ,,,,,,,,,,,,,,,if  (v ==, 0)   ,,,,,,,,,,,,,,,{   ,,,,,,,,,,,,,,,,,,,x =, 1;   ,,,,,,,,,,,,,,,,,,,y =, 0;   ,,,,,,,,,,,,,,,}   ,,,,,,,,,,,,,,,if  (==v  1)   ,,,,,,,,,,,,,,,{   ,,,,,,,,,,,,,,,,,,,x =, 1;   ,,,,,,,,,,,,,,,,,,,y =, 0;   ,,,,,,,,,,,,,,,}   ,,,,,,,,,,,}      ,,,,,,,,,,,if  (radioButton2.Checked ,,, flag ==, 1)   ,,,,,,,,,,,{   ,,,,,,,,,,,,,,,if (时间+ label1.Location.Y  label1.Size.Height 祝辞=,(时间+ panel1.Location.Y  panel1.Size.Height))   ,,,,,,,,,,,,,,,{   ,,,,,,,,,,,,,,,,,,,h =, 1;   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null

c#如何实现会移动的文字效果