在多行TextBox中对齐文本? (VB.net) [英] Align Text in a multiline TextBox? (VB.net)

查看:644
本文介绍了在多行TextBox中对齐文本? (VB.net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我使用的是Visual Studio 2005

,我制作了一个形状像一个大矩形的多行texboxt:p

但是当我输入它时,文字是从左到右所以看起来文字就在一边。



如何将文本居中?



提前致谢!

So I'm using Visual Studio 2005
and I made a multiline texboxt that's shaped as a big rectangle :p
But when I type on it, the text is from Left to right so it looks like the text is just on one side.

How do I center the text?

Thanks in advance!

推荐答案

这个是简单的..



0.单击文本框。

1.在屏幕右侧,您可以看到解决方案资源管理器和属性选项卡。

2.请在属性选项卡上搜索文本对齐属性。

3.如果您希望它在左侧,右侧对齐,您可以设置它或者在中心。



如果你想要它更复杂(或在运行时这样做),你可以编码。

这是代码...

This one is the simple one..

0. Click the textbox.
1. On the right side of your screen, you can see the Solution Explorer and the Properties tab.
2. Kindly search for the Property "Text Align" on the Properties tab.
3. There you are, you can set it if you want it aligned on the left side, right side or on the center.

If you want it to be more complicated (or do it on runtime), you can code it.
This is the code...
textbox1.TextAlign=HorizontalAlignment.Center


这篇关于在多行TextBox中对齐文本? (VB.net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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