C#实现文字移动
来源:互联网 发布:fc2最新域名 fc2cn.com 编辑:程序博客网 时间:2024/06/06 14:27
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace label
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Point LPos;
private void Form1_Load(object sender, EventArgs e)
{
LPos = new Point(this.label1.Location.X, this.label1.Location.Y);
this.timer1.Start();
DataClasses1DataContext db = new DataClasses1DataContext();
List<DrugStock> DList = new List<DrugStock>();
DList = (from c in db.DrugStock select c).ToList();
if (DList != null && DList.Count > 0)
{
int i = 0;
foreach (DrugStock DInfo in DList)
{
label1.Text = label1.Text + "/r/n" + DInfo.ProduceCode;
}
}
}
private void timer1_Tick(object sender, EventArgs e)
{
//if (label1.Location.Y< 0 && Math.Abs(label1.Location.Y) - label1.Height >= 0)
//{
// label1.Location = new Point(panel1.Height, label1.Location.X);
// return;
//}
//label1.Location = new Point(label1.Location.Y, label1.Location.X);
int FWidth = this.panel1.Width;
int FHeight = this.panel1.Height;
Point LPos1 = new Point(this.label1.Location.X, this.label1.Location.Y);
if (LPos1.Y < FHeight)
{
this.label1.Location = new Point(LPos1.X, LPos1.Y- 2);
if (LPos1.Y <= 0-FHeight)
{
this.label1.Location = LPos;
}
return;
}
else
{
this.label1.Location = new Point(12,0);
}
}
//#region Properties
//[Category("Appearance"),
// Description("Label前景色")]
//public System.Drawing.Color LabelForeColor
//{
// get { return label1.ForeColor; }
// set { label1.ForeColor = value; }
//}
//[Category("Appearance"),
// Description("LabelText")]
//public string LabelText
//{
// get { return label1.Text; }
// set
// {
// label1.Text = value;
// if (value == "")
// timer1.Enabled = false;
// else timer1.Enabled = true;
// }
//}
//#endregion
}
}
- C#实现文字移动
- C#文字跟随鼠标移动
- marguee实现文字的移动
- C#实现文字竖排
- C#中如何实现文字在图片中移动,最好能在移动过程中慢慢消失
- C#文字随鼠标移动效果
- C#实现窗体移动
- java简单实现文字重复移动
- HTML中MARQUEE标签实现文字移动
- 两种方法实现文字的移动
- JavaScript实现跟随鼠标移动而移动的文字
- 文字移动
- C#程序实现鼠标移动
- 怎么让C#的label的文字左右移动
- C#中实现label文字循环滚动
- 实现随鼠标飘浮移动文字的JavaScript
- 用LCD 实现文字图形的移动和闪烁
- javascript 实现的移动文字 效果比marquee好
- Windows磁盘驱动基础教程
- javax.mail.NoSuchProviderException: No provider for pop3
- InstallShield---集成安装MSDE2000最小版本(二)
- Oracle物化视图简介及实战
- C# 使用WebRequest 实现FTP常用功能
- C#实现文字移动
- Flex Data Services安装及学习笔记
- C++的new(转)
- 归并排序法(MergeSort)c++实现
- C++读写流文件(转)
- 【分享】嵌入式Linux典型案例分析!
- I2S(Inter—IC Sound)
- 对Oracle的一致和不一致备份相关概念的理解
- How to Swap Two Int-type Integers