c#中textbox屬性
Here we are demonstrating use of Visible property of TextBox Control.
在這里,我們演示了TextBox Control的Visible屬性的使用。
Visible property contains two values
可見屬性包含兩個值
True: Using this - textbox can be visible on parent control form
True :使用此選項-文本框在父控件窗體上可見
False: Using this - textbox can be hide on parent control form
False :使用此方法-文本框可以隱藏在父控件窗體上
By default this is True.
默認情況下為True。
Example:
例:
In this example, we took a Windows form that contains a textbox and button named txtInput and btnShow respectively, we can change the name of the control using name property. And we set Visible property to False. Using property window, we can open property window using "F4" short-cut key for selected control.
在此示例中,我們采用Windows窗體,其中分別包含一個名為txtInput和btnShow的文本框和按鈕,我們可以使用name屬性更改控件的名稱。 并且我們將Visible屬性設置為False 。 使用屬性窗口,我們可以使用“ F4”快捷鍵打開所選控件的屬性窗口。
Code to show TextBox on 'button_click' Event:
在“ button_click”事件上顯示TextBox的代碼:
private void btnShow_Click(object sender, EventArgs e)
{
textInput.Visible = true;
}
翻譯自: https://www.includehelp.com/dot-net/textbox-visible-property-with-example.aspx
c#中textbox屬性