• 大小: 676KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-08
  • 语言: C#
  • 标签: 票据打印  源代码  

资源简介

用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\baseForm.cs

     文件      15857  2009-09-22 03:02  BillSystem\BillSystem\baseForm.Designer.cs

     文件       6571  2009-09-22 01:43  BillSystem\BillSystem\baseForm.resx

     文件       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.baseForm.resources

............此处省略39个文件信息

评论

共有 条评论