简体   繁体   English

如何在Visual Studio C#上制作输出标签

[英]How do I make a Output Label on Visual Studio C#

I am new at using Visual Studio as well as C#. 我是使用Visual Studio和C#的新手。 I'm having a hard time trying to figure out how to make a output label. 我很难弄清楚如何制作输出标签。 Does anyone know how to do this? 有谁知道如何做到这一点?

What I've currently been doing is dragging the label control to the text box. 我目前正在做的是将标签控件拖到文本框中。 Then, I would delete the text from the label but then it looks like it disappeared . 然后,我将从标签中删除文本,但是看起来好像消失了。

I think, this is what you want, 我想这就是你想要的

System.Windows.Forms.Label label1 = new System.Windows.Forms.Label();
label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
label1.Location = new System.Drawing.Point(34, 49);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(85, 23);
label1.TabIndex = 0;
label1.Text = "label1";
label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

first of all: this is broad question! 首先:这是一个广泛的问题! I'll just answer according to my understanding. 我会根据我的理解回答。

Define the AutoSize of your label to False , then you can erase its text ( label1.Text = String.Empty ) without the label being seen as if it disappeared labelAutoSize定义为False ,然后可以擦除其文本( label1.Text = String.Empty ),而不会看到标签消失了

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Visual Studio 2015输出窗口中阻止C#编译器输出? - How do I stop the C# compiler output from wrapping in the Visual Studio 2015 output window? 如何从 c# 将彩色文本写入 Visual Studio 输出窗口? - How do I write color text to the Visual Studio output window from c#? 在带有C#的Visual Studio中,如何在键入时自动显示(),例如.Focus()? - In Visual Studio with C#, how do I make the () appear automatically when I type, such as .Focus()? 如何在 Visual Studio C# 中制作一个将特定文本插入文本框中的按钮? - How do i make a button that inserts A Certain text into a textbox in Visual Studio C#? 如何使 Visual Studio 中 Unity 的 C# 代码看起来/像教程中那样工作(图片) - How do I make my C# code for Unity in Visual Studio look/work like in the tutorial (picture) Visual Studio 2012中的C#。如何在64位模式下进行调试? - C# in Visual studio 2012. How do I make it debug in 64 bit mode? 输入特定输入后,如何使if语句转至某个点? Microsoft Visual Studio C# - How do I make an if statement goto a point when a certain input is entered? Microsoft Visual Studio C# 如何为我的 Visual Studio 2010 C# 项目制作安装程序? - How do I make an installer for my Visual Studio 2010 C# project? 如何在 C# (Visual Studio) 中进行热键控制 - How can I make Hotkey control at C# (Visual Studio) 如何在C#中的特定标签上创建工具提示点? - How do I make a tooltip point at a specific label in C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM