2 Replies - 1164 Views - Last Post: 05 April 2012 - 08:12 AM Rate Topic: -----

#1 Codey09  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 214
  • Joined: 20-August 09

[SOLVED] Input Box?

Posted 05 April 2012 - 06:43 AM

Is there an Inbut box available in windows as I working on a file management program in xna where I am using win forms to get message boxes and folder dialog boxes.

Was hoping there is an input one or a way of implementing one?

This post has been edited by Codey09: 05 April 2012 - 08:12 AM

Is This A Good Question/Topic? 0
  • +

Replies To: [SOLVED] Input Box?

#2 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1461
  • View blog
  • Posts: 3,289
  • Joined: 30-January 11

Re: [SOLVED] Input Box?

Posted 05 April 2012 - 06:54 AM

You could do this in a couple of different ways.

1. Add the reference "Microsoft Visual Basic .NET Runtime" to your project.

Add "using Microsoft.VisualBasic;"

The you can use the 'Interaction.Inputbox' method.

For example -

string x = Interaction.InputBox("Question goes here","Title here","Default Text");

// Do something with the input


2. Perhaps a more versatile way would be to create your own. Inherit from Form and provide your own implementation. When the user presses the OK button, fire an event and get the input from a public property.

You may find this useful - How to get values from Form1 to Form2

This post has been edited by Ryano121: 05 April 2012 - 07:09 AM

Was This Post Helpful? 2
  • +
  • -

#3 Codey09  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 214
  • Joined: 20-August 09

Re: [SOLVED] Input Box?

Posted 05 April 2012 - 08:12 AM

Thank you I've gone for the Visual Basic route this time as I'm short on time to get this finished.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1