zoukankan      html  css  js  c++  java
  • C# winform 中实现label字体移动

    代码
     1  
     2     #region//拼接字符
     3         private void timer1_Tick(object sender, EventArgs e)
     4        {
     5            int length=label1.Text.Length;
     6          string str = label1.Text.Substring(01);
     7           string str2 = label1.Text.Substring(1, length-1);
     8         label1.Text = str2 + str;
     9        }
    10         #endregion
    11 
    12 
    13    #region//改变label位置(推荐)
    14         private void timer1_Tick(object sender, EventArgs e)
    15         {
    16             if (label1.Location.X < 0 && Math.Abs(label1.Location.X) - label1.Width >= 0)
    17             {
    18                 label1.Location = new Point(panel1.Width, label1.Location.Y);
    19                 return;
    20             }
    21             label1.Location = new Point(label1.Location.X - 5, label1.Location.Y);
    22         }
    23 
    24         #endregion
     
    都是基于timer实现。
  • 相关阅读:
    ssh
    ssh免密码登陆
    滑雪[dp]
    Help Jimmy[dp]
    动态规划 [子序列问题]
    最佳加法表达式 [dp]
    求排列的逆序数[归并排序]
    输出前m大个数,时间复杂度O(n+mlog(m)) [快排]
    不会递归?五道例题教你如何递归
    函数模板的琐碎笔记
  • 原文地址:https://www.cnblogs.com/angleSJW/p/1657761.html
Copyright © 2011-2022 走看看