0

hi all ,
i wrote a class that send and receives data from serial port .
the class uses serialport class. now I have a event handler that is being called when the incoming buffer has data. I also have a parsing method in my class.

my problem is that i want to show the parsed data on a textbox on my form.
the thing is that i cant access form1.textbox1 because its private, and i cant call the public parsing method from form1 because its an event.

i'm feeling its a common problem about passing data between classes
how do i do it ?

thanks
Zvika

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by zismad
0

Have the constructor in your serial port class take in a TextBox (and have a private TextBox field to hold the object). When you instantiate your serial port class in Form1, pass in the TextBox from your form.

Edited by jonsca: n/a

0

thanks jonsca,
not exactly what i had in mind but i used it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.