标题:字体每隔一秒变大或变小
取消只看楼主
丫运
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2011-3-26
结帖率:100%
已结贴  问题点数:20 回复次数:1 
字体每隔一秒变大或变小
在窗体中显示字符,字体每隔一秒变大些,变到一定寸尺后,每隔一秒字体又变小些,增加一个按钮,可以启动和停止字符串字体的大小,是怎样做的呢???????
搜索更多相关主题的帖子: 字符串 
2011-03-28 15:41
丫运
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2011-3-26
得分:0 
我做的:
 int a = 9;
        int b = 9;
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Interval = 1000;
            timer1.Enabled = false;
            toolTip1.SetToolTip(button1, "启动定时控件");
            toolTip1.SetToolTip(button2, "停止定时控件");
        }
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
                     
        }
        private void button2_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            if(a<30&&b==9)
            {
               a++;
               label1.Font = new Font("",a);
               if (a == 30)
                   b = 30;
            
            }
            if (b <30&&a == 30)
            {
                b--;
                label1.Font = new Font("",b);
                if (b == 9)
                    a = 9;
            }

            label1.ForeColor = Color.Red;
        }

开始我在凝望,最后我在歌唱。。。。
2011-03-28 19:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-334998-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017190 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved