如何使用 C# 在 Visual Studio 中创建文本框?

发布于 2024-10-10 06:11:07 字数 128 浏览 0 评论 0原文

我觉得问这个问题有点傻,因为它看起来很简单,但如何创建一个可以输入指令和类似内容的文本框。我不需要用户能够更改它,它只是给出指示。我尝试了标签,但它只允许一行。我需要一些可以容纳一段左右的内容。类似于安装程序中描述程序功能的框。我错过了什么?

I feel kind of silly asking this question as it seems really simple, but how do I create a text box that I can type in instructions and stuff like that. I don't need the user to be able to change it, it is just to give instructions. I tried the label, but it only allows one line. I need something that can allow about a paragraph or so. Similar to the box in an installer that describes what the program does. What did I miss?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一生独一 2024-10-17 06:11:07

您可以使用标签,但将其 AutoSize 属性设置为 false。这允许您根据需要调整标签的大小,并且它会自动将文本换行以适合。

您还可以将标签锚定到父表单,以便在用户调整父表单大小时自动调整文本大小并重排文本。

You can use a label but set its AutoSize property to false. This allows you to size the label as you wish and it will automatically wrap the text to fit.

You can also anchor the label to the parent form to have it automatically resize and reflow the text if the user resizes the parent form.

时间海 2024-10-17 06:11:07

您想要一个文本框,但将其“只读”属性设置为 TRUE,并且可能将“启用”设置为 FALSE

You want a text box, but set its Read Only property to TRUE, and maybe Enabled to FALSE

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文