생존기술_IT/C#

[C#] String to Control.name.. 문자열로 컨트롤 선택..

LeCafeCreme 2020. 10. 18. 18:52

this.Controls.Find("variableName", true)[0].BackColor

.. or..

var txtBox = this.Controls.Find("textBox4", true);

stackoverflow.com/questions/12055648/converting-string-to-a-control-name-in-c-sharp

 

converting string to a control name in C#

Possible Duplicate: Find a control in C# winforms by name Imagine that we have 4 textBoxes (and a button): textBox1:( Here we must enter the name of the textBox where we want to change

stackoverflow.com

 

'생존기술_IT > C#' 카테고리의 다른 글

[Winforms] .Resx 확장자 정의  (0) 2020.10.18
[C#]-[WPF] ClickOnce 배포 방식..  (0) 2020.10.07