资源简介
用vs2008 c#实现各种票据打印,灵活的模板实现套打连打自定义票据尺寸以及票据的保存导出功能开发用时1个月同我朋友一起制作的呵呵。
代码片段和文件信息
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;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
namespace BillSystem
{
///
/// 基类,提供基本功能
///
public partial class baseForm : Form
{
public baseForm()
{
InitializeComponent();
}
public Control cl = null;
protected String txt = ““;
public MainForm mf = null;
protected bool isok = true;
//Load
protected void baseForm_Load(object sender EventArgs e)
{
Model.Click += new EventHandler(Controls_Click);
}
//鼠标滚动
protected void baseForm_Scroll(object sender ScrollEventArgs e)
{
panMenu.Location = new Point(0 0);
}
//向模板添加控件
public virtual void Model_ControlAdded(object sender ControlEventArgs e)
{
var obj = e.Control;
Type type = obj.GetType();
if (type.Name == “TextBox“)
{
TextBox temp = (TextBox)obj;
temp.Multiline = true;
}
obj.Click += new EventHandler(Controls_Click);//注册事件
}
//控件单击事件
public virtual void Controls_Click(object sender EventArgs e)
{
cl = (Control)sender;
numWidth.Value = cl.Width;
numHeight.Value = cl.Height;
Console.WriteLine(cl.Name);
}
//位置调整
protected void btn_Click(object sender EventArgs e)
{
txt = ((Button)sender).Text;
if (cl != null)
{
setLocation();
}
}
//鼠标按下
protected void btn_MouseDown(object sender MouseEventArgs e)
{
txt = ((Button)sender).Text;
if (cl != null)
{
MoveTimer.Enabled = true;
}
}
//鼠标放开
protected void btn_MouseUp(object sender MouseEventArgs e)
{
MoveTimer.Enabled = false;
}
//快速位置移动
protected void MoveTimer_Tick(object sender EventArgs e)
{
setLocation();
}
//位置调整
protected void setLocation()
{
switch (txt)
{
case “上“:
cl.Location = new Point(cl.Location.X cl.Location.Y - 1);
break;
case “下“:
cl.Location = new Point(cl.Location.X cl.Location.Y + 1);
break;
case “左“:
cl.Location = new Point(cl.Location.X - 1 cl.Location.Y);
break;
case “右“:
cl.Location = new Point(cl.Loc
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 7440 2009-09-23 12:12 BillSystem\BillSystem\ba
文件 15857 2009-09-22 03:02 BillSystem\BillSystem\ba
文件 6571 2009-09-22 01:43 BillSystem\BillSystem\ba
文件 7031 2009-09-25 21:23 BillSystem\BillSystem\BillSystem.csproj
文件 84992 2009-09-26 17:53 BillSystem\BillSystem\bin\Debug\BillSystem.exe
文件 103936 2009-09-26 17:53 BillSystem\BillSystem\bin\Debug\BillSystem.pdb
文件 14328 2009-09-26 17:53 BillSystem\BillSystem\bin\Debug\BillSystem.vshost.exe
文件 490 2007-07-21 01:33 BillSystem\BillSystem\bin\Debug\BillSystem.vshost.exe.manifest
文件 1029 2009-09-26 17:53 BillSystem\BillSystem\bin\Debug\Data
文件 1093632 2009-09-26 17:53 BillSystem\BillSystem\bin\Debug\Interop.Excel.dll
文件 217088 2009-09-26 17:53 BillSystem\BillSystem\bin\Debug\Interop.Microsoft.Office.Core.dll
文件 57344 2009-09-26 17:53 BillSystem\BillSystem\bin\Debug\Interop.VBIDE.dll
文件 4233 2009-09-23 11:56 BillSystem\BillSystem\ContriveForm.cs
文件 7736 2009-09-23 11:56 BillSystem\BillSystem\ContriveForm.designer.cs
文件 6571 2009-09-23 11:56 BillSystem\BillSystem\ContriveForm.resx
文件 9368 2009-09-22 15:20 BillSystem\BillSystem\DataDispose.cs
文件 4720 2009-09-22 15:11 BillSystem\BillSystem\DataDisposeForm.cs
文件 11252 2009-09-22 14:26 BillSystem\BillSystem\DataDisposeForm.designer.cs
文件 6005 2009-09-22 14:26 BillSystem\BillSystem\DataDisposeForm.resx
文件 5086 2009-09-23 22:59 BillSystem\BillSystem\GreatChar.cs
文件 6319 2009-09-26 17:48 BillSystem\BillSystem\MainFrom.cs
文件 12506 2009-09-26 17:37 BillSystem\BillSystem\MainFrom.designer.cs
文件 25590 2009-09-26 17:37 BillSystem\BillSystem\MainFrom.resx
文件 9928 2009-09-26 17:50 BillSystem\BillSystem\ModelForm.cs
文件 7991 2009-09-26 17:50 BillSystem\BillSystem\ModelForm.designer.cs
文件 6762 2009-09-26 17:50 BillSystem\BillSystem\ModelForm.resx
文件 2407 2009-09-22 01:13 BillSystem\BillSystem\NewControlForm.cs
文件 13071 2009-09-18 13:35 BillSystem\BillSystem\NewControlForm.designer.cs
文件 25231 2009-09-18 13:35 BillSystem\BillSystem\NewControlForm.resx
文件 180 2009-09-26 17:53 BillSystem\BillSystem\obj\Debug\BillSystem.ba
............此处省略39个文件信息
- 上一篇:C# 语法全解
- 下一篇:一个很不错的C#录音控件源码,帮您提供提示出错的解决方案
相关资源
- 一种图纸数字化程序的C#编程实现
- 使用C#实现加密狗身份验证源代码
- CLR Via C#(第4版) 完整源代码
- ASP.net酒店管理系统源代码
- C# 的连连看小游戏源代码
- C#小游戏拯救大行动源代码
- C#ListView控件使用简单源代码
- JS调用c#编写的DLL 源代码
- 基于SOCKET实现FTP客户端源代码
- C#源代码 读取多个txt写入excel
- asp.net文件源代码
- C#远程控制服务器端和客户端源代码
- ASP.NET+SQL网上校友录设计与实现(源代
- 火车票售票系统C#源代码
- C#WinForm基于BS构架实现CS及源代码
- c#五子棋游戏源代码200445
- 员工管理信息系统C#源代码
- c#红绿灯程序源代码
- VS2010下 C#最小二乘法图形界面及源代
- WPF写的一个简单截屏工具
- C#版学生管理系统源代码
- (源代码)C#作为上位机,控制51单片
- c#上位机串口通信助手源代码194215
- C#非接触IC卡M1卡读写调试源代码(适
- 自来水收费管理系统c# 源代码
- C# u盘操作源代码
- C#单点定位
- C#TCP服务器和客户端Winform源代码
- 《零基础学C#》明日科技出版丛书光盘
- Winform利用资源文件实现多国语言(含
评论
共有 条评论