달력

112024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

               
// Reflection 으로 Field 를 찾는다.
 
FieldInfo fieldInfo = null;
Label lbl = null;

fieldInfo = this.GetType().GetField("treatmentLbl_" + i, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public);

if(fieldInfo != null){
    lbl = (Label)fieldInfo.GetValue(this);
    lbl.Text = "xxx";
}

Posted by tornado
|