-
Re: How do you make an InputBox in C#
Max,
>It was easy for me to find System.Windows.Forms.MessageBox.Show() to get the
>MsgBox to pop up, but how do you get the InputBox?
Create a Form with a Textbox, two Buttons and a Label on it.
Mattias
===
Mattias Sjögren (VB MVP)
mattias @ mvps.org
http://www.msjogren.net/dotnet/
-
How do you make an InputBox in C#
It was easy for me to find System.Windows.Forms.MessageBox.Show() to get the
MsgBox to pop up, but how do you get the InputBox?
Thanks
-
Re: How do you make an InputBox in C#
In article <3d06571b$1@10.1.10.29> (from max caber
<maxcaber@yahoo.com>),
>
> It was easy for me to find System.Windows.Forms.MessageBox.Show() to get the
> MsgBox to pop up, but how do you get the InputBox?
You could always use the one from VB.NET if you don't want to make one
yourself:
using System;
using System.Windows.Forms;
using System.Drawing;
using Microsoft.VisualBasic; // include VB.NET functions
class MainForm : Form
{
private Button m_Button;
public MainForm()
{
Text = "This is my form";
m_Button = new Button();
m_Button.Size = new Size(60,30);
m_Button.Location = new Point(5,5);
m_Button.Text = "Show";
m_Button.Click += new EventHandler(show_inp);
this.Controls.Add(m_Button);
}
public void show_inp(object sender, EventArgs e)
{
string str = Interaction.InputBox("Prompt", "Title", "<def>", 30, 40);
}
public static void Main(string[] args)
{
Application.Run(new MainForm());
}
}
--
Patrick Steele
Microsoft .NET MVP
-
Re: How do you make an InputBox in C#
Patrick Steele [MVP] <patrick@mvps.org> wrote:
using Microsoft.VisualBasic; // include VB.NET functions
//other code
string str = Interaction.InputBox("Prompt", "Title", "<def>", 30, 40);
//more code
Are the classes in the Microsoft.VisualBasic namespace part of the ECMA standard?
Max
-
Re: How do you make an InputBox in C#
In article <3d0761cc$1@10.1.10.29> (from max caber
<maxcaber@yahoo.com>),
>
> Patrick Steele [MVP] <patrick@mvps.org> wrote:
>
> using Microsoft.VisualBasic; // include VB.NET functions
> //other code
> string str = Interaction.InputBox("Prompt", "Title", "<def>", 30, 40);
> //more code
>
> Are the classes in the Microsoft.VisualBasic namespace part of the ECMA standard?
I doubt it. It's my understanding that the ECMA standard is on the C#
language, not any particualr set of namespaces.
--
Patrick Steele
Microsoft .NET MVP
-
Re: How do you make an InputBox in C#
Patrick Steele [MVP] <patrick@mvps.org> wrote:
>I doubt it. It's my understanding that the ECMA standard is on the C#
>language, not any particualr set of namespaces.
I read that the ECMA standard was on the C# language and the .NET API. If
you go to http://www.go-mono.com/, you will see the progress evolving with
the open source implementation of the .NET class libraries and C# compiler.
As for VB.NET, when there is a .NET class/method that performs the same function
as a "built in VB command", I choose the .NET class/method because it is
more portable across languages and future platforms.
I do appreciate all the responses to my original question, "How do you make
an InputBox in C#?", but I would like to find a .NET class/method that does
this.
-
Re: How do you make an InputBox in C#
"Michael \(michka\) Kaplan" <former_mvp@nospam.trigeminal.spamless.com> wrote:
>As many have said before, there is not one.
>
>But you should feel free to keep asking and getting back the same answer
>until you understand. :-)
Responses to my question demonstrated ways to manually create a Form containing
a TextBox and Buttons, and how to use a VB.NET class to show an InputBox.
However, you are the first to inform me that, "there is not one” (a .NET
ECMA standard class/method to show an input box). Thank you for providing
me with this surprising information.
I do have to admit that I am a little taken back, because there has been
an InputBox Function in VB since I can remember, there is one in JavaScript,
and Java. How could the .NET people have forgotten such a simple, useful,
practical thing, when they thought of everything else?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks