5 Replies - 887 Views - Last Post: 21 October 2014 - 11:33 AM Rate Topic: -----

#1 Yips   User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 64
  • Joined: 11-October 14

User Input Numbers in Created Classes

Posted 21 October 2014 - 10:42 AM

Is there anyway to have the user input the numbers they wish to add in the specific class made for addition instead of already inputted numbers?
Is This A Good Question/Topic? 0
  • +

Replies To: User Input Numbers in Created Classes

#2 rusoaica   User is offline

  • They're watching you, Neo!
  • member icon

Reputation: 221
  • View blog
  • Posts: 691
  • Joined: 10-March 12

Re: User Input Numbers in Created Classes

Posted 21 October 2014 - 10:49 AM

Of course there is. If you are making a console application, you can use Console.ReadLine()
If you are making a Windows Forms application, you can use InputBox.
Was This Post Helpful? 0
  • +
  • -

#3 Yips   User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 64
  • Joined: 11-October 14

Re: User Input Numbers in Created Classes

Posted 21 October 2014 - 11:02 AM

View Postrusoaica, on 21 October 2014 - 10:49 AM, said:

Of course there is. If you are making a console application, you can use Console.ReadLine()


I use console.readline a lot in the console applications, which is what I'm mainly learning right now. But where would the console.readline function within the public class?
Was This Post Helpful? 0
  • +
  • -

#4 rusoaica   User is offline

  • They're watching you, Neo!
  • member icon

Reputation: 221
  • View blog
  • Posts: 691
  • Joined: 10-March 12

Re: User Input Numbers in Created Classes

Posted 21 October 2014 - 11:12 AM

You should put in inside your Main method, if it is a console application. If not, put the InputBox in the Load event of your form, or in a button's Click event or wherever you need your input to be placed. You can create a variable and assign its value the result of the Console.ReadLine or InputBox methods.
Was This Post Helpful? 1
  • +
  • -

#5 Yips   User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 64
  • Joined: 11-October 14

Re: User Input Numbers in Created Classes

Posted 21 October 2014 - 11:26 AM

Thanks, very helpful.
Was This Post Helpful? 0
  • +
  • -

#6 rusoaica   User is offline

  • They're watching you, Neo!
  • member icon

Reputation: 221
  • View blog
  • Posts: 691
  • Joined: 10-March 12

Re: User Input Numbers in Created Classes

Posted 21 October 2014 - 11:33 AM

You're welcome! :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1