建立在C#中的“标签​​设计” [英] Creating a 'label designer' in C#

查看:199
本文介绍了建立在C#中的“标签​​设计”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个相当简单的标签打印机,以补充提供我们网站上的服务(处理采用IPN贝宝支付和输出包含定制的交易信息的 CSV 文件)。

I'm trying to create a fairly simple label printer to complement the services offered on our website (processing PayPal payments using IPN and outputting a CSV file containing customizable transaction information).

我已经得到了打印机模块大多排序,但我想要的软件的用户能够调整部分信息,类似于由兄弟提供的P-touch软件的定位。

I've got the printer module mostly sorted, but I wanted users of the software to be able to adjust the positioning of pieces of information, similar to the P-Touch software provided by Brother.

该过程包括装载在 CSV 的文件,与各列标题。然后,您应该能够走动布局中的列标题 - 空格形式的窗口,然后,理想情况下,将捕捉到对齐网格的中间。

The process consists of loading in a CSV file, with various column headers. You should then be able to move the column headers about the layout - whitespace in the middle of the form window, which then, ideally, would snap to an alignment grid.

在该用户可以选择打印preVIEW,并根据不同的标签的尺寸,其中该数据源是CSV文件打印标签。

After that the user can select print preview, and print the labels according to the different label sizes available, where the data source is the CSV file.

我的主要问题是标签设计,我不知道从哪里开始。我使用的Visual防爆preSS 2010测试版和C#。

My primary issue is the "label designer", and I have no idea where to start. I am using Visual Express 2010 beta and C#.

推荐答案

基本上你需要允许用户拖动围绕一个形式标签(对象,控制等)。

Basically you need to allow the user to drag labels (objects, controls etc.) around a "form".

<一个href="http://stackoverflow.com/questions/1086989/dragging-picturebox-inside-winform-on-runtime">http://stackoverflow.com/questions/1086989/dragging-picturebox-inside-winform-on-runtime

然后,你需要能够捕捉到网格的同时拖动(铜codeR解决方案):

Then you need to be able to snap to a grid while dragging (coppercoder's solution):

<一个href="http://stackoverflow.com/questions/359229/snap-to-grid-mouse-locking-up/359922#359922">http://stackoverflow.com/questions/359229/snap-to-grid-mouse-locking-up/359922#359922

定义一个抽象的对象,它封装了标签,你希望你的用户(或面板,或任何控制使用模拟纸张)。

Defining an abstract "object" that encapsulates the "labels" you want your user to "drag around the form" (or panel, or whatever control you use to simulate your paper).

我想我已经做到了这一点,足以觉得相当琐碎,但如果这是你第一次实施这样的事情它可以是一个艰巨的任务。获取功能工作的一小部分,你会做到。当然,你总是有StackOverflow上的问题。

I guess I've done this enough to find it fairly trivial, although if it's your first time implementing something like this it can be a daunting task. Get small portions of functionality working and you'll make it through. Of course you always have stackoverflow for questions.

这篇关于建立在C#中的“标签​​设计”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆