Windows 窗体中标签控件的换行符问题 [英] Line break issue with label control in Windows Forms

查看:23
本文介绍了Windows 窗体中标签控件的换行符问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在 Winforms 中有一个标签控件,我想做一些类似的事情:

Say I have a label control in Winforms and I want to do some thing like:

1) 一个
2)两个

1) One
2) Two

我该怎么做?如果我在字符串中添加\n",它似乎不起作用.标签控件天生就是单行吗?

How do I to that? If I add a "\n" to the string it does not seem to work. Is the label control inherently single line?

推荐答案

在设计器中选择标签.
在标签的属性表中单击文本属性项.该属性将显示为组合.
展开组合并输入您的文本,包括换行符.

In the Designer select the Label.
In the Label's property sheet click the Text property item. The property will display as a combo.
Expand the combo and enter your text, including line returns.

这篇关于Windows 窗体中标签控件的换行符问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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