![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Dec 2006
Posts: 47
Rep Power: 0
![]() |
Help with GUI in C#
So basically I've made a C# client application that can run in the console. I am trying to add a GUI to it. I have 2 applications, one a console application that holds my logic called ClientApp and a windows form containing the GUI called ClientApp. Rather than post the logic and base could into the windows form class I have tried to rather make them work together (which I am told is the way to go). I have got method that takes the TCP address the person wishes to connect to in my forms class.
public void serverString_TextChanged_1(object sender, EventArgs e) { string TCPaddress = serverString.Text; } Simply takes the text entered by the user and puts it in a string called TCPaddress. My problem is I am trying to get this information into my actual ClientApp application that connects to the client. I've made a reference to my Client Form called: ClientForm clientform = new ClientForm(); In my class thats holds the base and logic called ClientApp, the protocol to connect looks like this: client.Connect("www.amazon.co.uk", 43); The first being the site, second being the port. but I am trying to feed in what the user has said entered in the textbox from my ClientForm into the clientApp in the area with "amazon.co.uk" by doing something such as: client.Connect(clientform.serverString_TextChanged_1(TCPaddress) but it doesnt work!!! :mad: I tried to make a get method that would return TCP address but obviously TCP address is only within the scope of that method. Help!!! Been stuck for 4-5 hours! |
|
|
|
|
|
#2 |
|
Expert Programmer
|
first of all use code tags when posting, second could you please post all of your code.
__________________
|
|
|
|
|
|
#3 |
|
Professional Programmer
|
So when does client.Connect() get called? You might want to put that inside the onClick event handler of your button.
__________________
JG-Webdesign |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|