c# GUI changing a listbox from another class
- by SlowForce
I've written a multithreaded server that uses tcplistener and a client handler class that controls input and output. I also have a GUI chat client. The chat client works fine and the console version of the server also works well.
I have a start() method in the partial(?) Form class, which I run from a new thread when I click a button, that starts the TCP Listener and loops through and accepts socket requests. For every request a new ClientHandler object is created and the socket is passed to this object before being used in a new handler thread.
The ClientHandler is a different class to the form and I'm having real problems writing data to the Listbox in the Form class from within the ClientHandler class. I've tried a few different ways of doing this but none of them work as they involve creating a new form class within the ClientHandler.
Any help or advice on what I should be reading to help me would be really appreciated.