prompt

  • Thread starter Thread starter Bill Yin
  • Start date Start date
B

Bill Yin

javascript-- prompt
C# -- ????
I want pop a winform for inputting my password before submitting
 
Bill said:
javascript-- prompt
C# -- ????
I want pop a winform for inputting my password before submitting

You'll still have to use javascript...

Page.RegisterStartupScript("ClientScript", strScript)
 
But I use it in winForm ,not in Asp.net....



Microsoft Towel Boy said:
You'll still have to use javascript...

Page.RegisterStartupScript("ClientScript", strScript)
 
In a Windows Form, you need to create a custom dialog to show the prompt and
allow input. If you just want a simple MessageBox, try
System.Windows.Forms.MessageBox.Show()

-mike
MVP
 
Hi Bill Yin,

Yeah MessageBox.Show() is the way to go.

There a few parameters which you can used MessageBox.Show()

1 simple example,

MessageBox.Show("Hello Bill Yin");

But you can set the dialog box title bar, the icons used, etc. Good Luck!
 
ÄãºÃ
WINFORMÄǸüÊDz»¿ÉÄÜÓÐÏó½Å±¾Ò»ÑùµÄ·½·¨ÁË
ËûÊÇ´°ÌåµÄ¸ÅÄî
 
Bill,

Simple example:

on Form1 (calling form)

private void button1_Click(object sender, System.EventArgs e)
{
Form2 f2 = new Form2();
if (f2.ShowDialog() == DialogResult.OK)
{
MessageBox.Show(f2.PW);
}
}

on Form2 (prompt/dialog form)

public string PW
{
get
{
return textBox1.Text;
}
}

On Form2 set the DialogResult properties of your buttons to the
appropriate values (OK, Cancel, etc.) so they set the ShowDialog()
return value and close the close the form.

-Dan Shanyfelt
 
Back
Top