Parameter passing problem

  • Thread starter Thread starter Danielo
  • Start date Start date
D

Danielo

Hi all,

I'm a C# newbie and need some help

I have a small program that connects to Active directory.
I use two forms and in the main form i have a class that searches for
security groups and writes the output to the textbox on the main form,
This works perfectly But when i call the same class from within the
second form is does not write to the textbox in the main form.
I placed a messagebox in the class to check if it was receiving any
data, and it did but the textbox stays blank.

Any help would be appreciated

Danielo
 
Hi Danielo
you are not able to write to the textbox simply because it is a private
member of the main form ... therefore, you cannot access it and chnage its
text property form the second form ...... even if it was a public member
still the the second form can't reach it because it has no reference to the
main form . It is the other way around so the main from can access the
other but not the opposite, otherwise you would have what is called a
circler reference....... hope that was clear
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Mohamed,

Thanks for your reply.

You where right it was the other way around, it works perfect now.
Thanks alot for your help.

Danielo
 
glad you solved it ,that is great :) please feel free to share any new
issues you have.....
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top