accessing controls on parentform from childform

后端 未结 3 1104
花落未央
花落未央 2021-01-14 14:53

I want to change text in textbox on parentform from childform. I set textbox

modifiers= public i have extra written a function in parentform

publ         


        
3条回答
  •  情话喂你
    2021-01-14 15:41

    I think the problem is that ParentForm is of type Form which does not have a member txtbox. You need to cast ParentForm to your form (suppose it is Form1), like:

    ((Form1)this.ParentForm).txtbox
    

提交回复
热议问题