客户地址对于 POS 收据而言太大

发布于 2025-01-10 04:25:02 字数 442 浏览 4 评论 0原文

我使用这条线将客户地址添加到我的 POS 收据中:

graphics.DrawString(
     "Address: " + _selectedCustomer.address, 
     new Font("Calibri", 8), 
     new SolidBrush(Color.Black), 
     startX + 15, 
     startY + Offset
);

但问题是客户地址对于我的收据来说太大了(35 到 40 个字符)。 我需要根据客户地址的长度将字符串换行为 2 或 3 行。

输入图片此处描述

I'm using this line to add customer address to my POS receipt:

graphics.DrawString(
     "Address: " + _selectedCustomer.address, 
     new Font("Calibri", 8), 
     new SolidBrush(Color.Black), 
     startX + 15, 
     startY + Offset
);

but the problem is customer address is way too big for my receipt ( 35 to 40 char).
I need to make the string wrap in 2 or 3 lines based on the length of the customer address.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文