Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Nov 27th, 2005, 1:23 PM   #1
nez
Programmer
 
nez's Avatar
 
Join Date: May 2005
Location: Plymouth UK
Posts: 34
Rep Power: 0 nez is on a distinguished road
Send a message via MSN to nez
simple thing, big headache :(

Hi all, i havnt bee around for a quite a while, been back at uni and its rather hectic, but i've found some time to program again, which is good because i really enjoy it.

Problem is...

Im using Visual C# express, and i cant for the life of me remember how to show and int in a text box

I know i've done it before, and easily too, but i cant remember, like those days when you forget how to spell words like "who" or is that jsut me?

I've built a nice GUI for my project, but not being able to do this has slowed me down somewhat, i feel rather dumb asking, but i cant work it out

Cheers
Nez
p.s. i'm sure i'll be hanging around here more often now i have a bit more free time
__________________
atariboy.wordpress.com
nez is offline   Reply With Quote
Old Nov 27th, 2005, 1:39 PM   #2
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
int myInt = Convert.ToInt32(myString);
That should do it.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Nov 27th, 2005, 2:14 PM   #3
nez
Programmer
 
nez's Avatar
 
Join Date: May 2005
Location: Plymouth UK
Posts: 34
Rep Power: 0 nez is on a distinguished road
Send a message via MSN to nez
*slaps head* Thank you ooble, i am forever in your debt. ;D
__________________
atariboy.wordpress.com
nez is offline   Reply With Quote
Old Nov 27th, 2005, 2:34 PM   #4
nez
Programmer
 
nez's Avatar
 
Join Date: May 2005
Location: Plymouth UK
Posts: 34
Rep Power: 0 nez is on a distinguished road
Send a message via MSN to nez
NEvermind, i've fixed it now

/*maybe im doing something stupid, but i get the error:

Cannot implicitly convert type 'int' to 'string'

I want to show

int value = 4;

in textBox1

my poor brain, sunday is not a good day to be thinking */
__________________
atariboy.wordpress.com
nez is offline   Reply With Quote
Old Nov 27th, 2005, 5:57 PM   #5
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
Oh, bugger - I got it the wrong way around. Glad to see you got it.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Nov 30th, 2005, 4:46 AM   #6
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
Or how about

TextBox.Text = Int32.Parse( myString );

I think pretty much all (well most) of the built-in types in C# have the Parse function, takes a string and produces the type you are looking for.
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu 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 11:28 PM.

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