多行文本在Windows窗体按钮标签 [英] Multiline text as the button label in Windows Forms

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

问题描述

基本上,我建立在椭圆形状的按钮。但我的按钮标签太长在一行中显示,所以我想,这样的椭圆形按钮看起来不错,它拆分成多行。

Basically, I am creating a button in an oval shape. But my button label is too long to display in one line, so I wanted to split it into multiple lines so that the oval button looks good.

我怎么上的按钮实现自动换行?

How do I enable word wrap on a button?

推荐答案

在设置窗体加载标签文本,并添加Environment.Newline作为换行符的字符串,是这样的:

Set the label text on form load and add Environment.Newline as the newline string, like this:

btnOK.Text = "OK" + Environment.NewLine + "true";

这篇关于多行文本在Windows窗体按钮标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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