如何在C#中隐藏我的表单的名称或标题 [英] How Do I Hide The Name Or Title Of My Form In C#
本文介绍了如何在C#中隐藏我的表单的名称或标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何隐藏我的表格的名称或标题在c#
i试过以下代码什么都没发生
Form1 f1 = new Form1();
f1.text =;
当我测试时没有任何反应上面的代码
i也尝试了这段代码。这是
this.text =;
什么都没发生。
请帮帮我
解决方案
如果您创建一个新实例,那么该实例就会发生变化,而不是那个可见的。
Text = ;如果你在表单中执行该代码,应该这样做:从外部你需要访问正在显示的表单实例的Text属性。
使用它而不是在表单加载中创建新对象。
form.Text = 串跨度> .Empty;
how do i hide the name or title of my form in c#
i have tried the following code nothing happened
Form1 f1 = new Form1 ();
f1.text = " " ;
nothing happen when i test the above code
i tried that code as well . which is
this.text = " " ;
nothing happened .
please help me out
解决方案
If you create a new instance, then changes happen to that instance, not to the one that is visible.
Text = "";Should do it, if you execute that code within the form: from outside you will need to access the Text property of the form instance that is being displayed.
use this instead of creating new object in form load.
form.Text = string.Empty;
这篇关于如何在C#中隐藏我的表单的名称或标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文