Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 9th, 2007, 1:16 PM   #1
csrocker101
Programmer
 
Join Date: Dec 2006
Posts: 47
Rep Power: 0 csrocker101 is on a distinguished road
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!
csrocker101 is offline   Reply With Quote
Old Mar 9th, 2007, 3:58 PM   #2
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 579
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
first of all use code tags when posting, second could you please post all of your code.
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is online now   Reply With Quote
Old Mar 9th, 2007, 7:14 PM   #3
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 417
Rep Power: 3 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
So when does client.Connect() get called? You might want to put that inside the onClick event handler of your button.
__________________
JG-Webdesign
Wizard1988 is offline   Reply With Quote
Old Mar 10th, 2007, 11:08 AM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
To get the text entered in a TextBox, just use TextBoxName.Text - it's a lot simpler than you think.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:32 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC