![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
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 |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
int myInt = Convert.ToInt32(myString); |
|
|
|
|
|
#3 |
|
Programmer
|
*slaps head* Thank you ooble, i am forever in your debt. ;D
__________________
atariboy.wordpress.com |
|
|
|
|
|
#4 |
|
Programmer
|
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 |
|
|
|
|
|
#5 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Oh, bugger - I got it the wrong way around. Glad to see you got it.
![]() |
|
|
|
|
|
#6 |
|
Expert Programmer
|
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|