TextBox垂直文本对齐方式(Windows窗体) [英] TextBox vertical text alignment (Windows Forms)

查看:188
本文介绍了TextBox垂直文本对齐方式(Windows窗体)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将文本对齐到Windows窗体中多行TextBox的底部 - 无法弄清楚如何!


在WPF中你可以设置VerticalContentAlignment属性,轻松回答,但看起来Windows窗体TextBox中没有这样的属性!


但我已经在基于Windows窗体的应用程序中看到它多次,我想知道他们是如何做到的?

I need to align text to the bottom of a multiline TextBox in Windows Forms - can''t figure out how!

In WPF you can set the VerticalContentAlignment property, easy answer, but it looks like there is no such property in Windows Forms TextBox!

But I have seen it done many times in Windows Forms-based apps and I wonder how do they do it?

推荐答案

嗯,我也说得不对,我最接近的就是在文本框中添加标签,设置标签'文本框的父级,并将标签'的dockstyle设置为bottom。也许别人有更好的OP解决方案?
Hmmm, I couldn''t get this right either, the closest I got to getting this right is to add a label to the textbox, set the label''s parent to the textbox and set label''s dockstyle to bottom. Maybe someone else has a better solution for the OP?


啊,我的大脑显然拒绝处理这个问题。你能提供像样机或mspaint图像来展示你的意思吗?


谢谢,对不起我的密集度:)
Ahhh, my brain refuses to process the problem apparently. Can you provide like a mockup or a mspaint image presenting what you what?

Thanks, and sorry for my denseness :)


什么可以这是一个类似终端的应用程序,您可以在窗口底部键入命令,文本从底部向顶部滚动。

这是我的快速和脏CAN的屏幕截图(控制区域网络)使用WPF制作的控制台应用程序,它使用textBox.VerticalContentAlignment = VerticalAlignment.Top属性:

What can be archived with this is a terminal-like application, where you type commands on the bottom of the window and the text scrolls from the bottom towards the top.
Here is a screenshot of my quick and dirty CAN (Control Area Network) console app made using WPF, which uses textBox.VerticalContentAlignment = VerticalAlignment.Top property:

展开 | 选择 | 换行 | 行号


这篇关于TextBox垂直文本对齐方式(Windows窗体)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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