Click here to Skip to main content
16,004,828 members
Home / Discussions / C#
   

C#

 
AnswerRe: Window Output???? Pin
Michael Flanakin22-Mar-04 3:35
Michael Flanakin22-Mar-04 3:35 
GeneralRe: Window Output???? Pin
Dave Kreskowiak22-Mar-04 8:11
mveDave Kreskowiak22-Mar-04 8:11 
GeneralRe: Window Output???? Pin
SherKar22-Mar-04 11:37
SherKar22-Mar-04 11:37 
GeneralRe: Window Output???? Pin
Michael Flanakin22-Mar-04 11:47
Michael Flanakin22-Mar-04 11:47 
GeneralApplication.Run Pin
scadaguy22-Mar-04 2:37
scadaguy22-Mar-04 2:37 
GeneralRe: Application.Run Pin
Heath Stewart22-Mar-04 3:39
protectorHeath Stewart22-Mar-04 3:39 
GeneralRe: Application.Run Pin
scadaguy22-Mar-04 5:11
scadaguy22-Mar-04 5:11 
GeneralRe: Application.Run Pin
Heath Stewart22-Mar-04 5:19
protectorHeath Stewart22-Mar-04 5:19 
Consider the following example:
using System;
using System.Drawing;
using System.Windows.Forms;

public class Test : Form
{
  static void Main()
  {
    Test t = new Test();
    t.ShowDialog();
    Application.Run();
  }

  TextBox tb;
  public Test()
  {
    tb = new TextBox();
    tb.Location = new Point(8, 8);
    Controls.Add(tb);

    Button b = new Button();
    b.Location = new Point(tb.Right + 8, tb.Top);
    b.Text = "Click";
    b.Click += new EventHandler(b_Click);
    Controls.Add(b);
  }

  private void b_Click(object sender, EventArgs e)
  {
    MessageBox.Show(tb.Text);
    Application.Exit();
  }
}
Now, I'm not sure why you'd want to do this, but you could. It's most likely that this would be handy when you want to have a dialog that doesn't act as the main window handle for an application that receives general application messages posted to the pump. You'll notice (if you compile and run this) that closing the dialog doesn't quit the application. Perhaps someone might have a good reason for using such an approach.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Application.Run Pin
scadaguy22-Mar-04 5:41
scadaguy22-Mar-04 5:41 
GeneralRe: Application.Run Pin
HAHAHA_NEXT22-Mar-04 8:38
HAHAHA_NEXT22-Mar-04 8:38 
Generalactive directory users listing Pin
agakyurek21-Mar-04 23:42
agakyurek21-Mar-04 23:42 
GeneralRe: active directory users listing Pin
Heath Stewart22-Mar-04 3:54
protectorHeath Stewart22-Mar-04 3:54 
QuestionHow to: Registry Pin
bouli21-Mar-04 22:55
bouli21-Mar-04 22:55 
Generalunknown exception thrown when decrypting read-in message Pin
chau_fai_rubbish21-Mar-04 21:36
chau_fai_rubbish21-Mar-04 21:36 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
chau_fai_rubbish22-Mar-04 2:34
chau_fai_rubbish22-Mar-04 2:34 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
Heath Stewart22-Mar-04 3:17
protectorHeath Stewart22-Mar-04 3:17 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
Heath Stewart22-Mar-04 3:23
protectorHeath Stewart22-Mar-04 3:23 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
chau_fai_rubbish22-Mar-04 15:00
chau_fai_rubbish22-Mar-04 15:00 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
Heath Stewart23-Mar-04 2:56
protectorHeath Stewart23-Mar-04 2:56 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
terry_cyf23-Mar-04 20:40
terry_cyf23-Mar-04 20:40 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
Heath Stewart24-Mar-04 2:46
protectorHeath Stewart24-Mar-04 2:46 
GeneralFormatting Strings Pin
Maharishi Bhatia21-Mar-04 18:35
Maharishi Bhatia21-Mar-04 18:35 
GeneralRe: Formatting Strings Pin
Heath Stewart21-Mar-04 18:56
protectorHeath Stewart21-Mar-04 18:56 
GeneralRe: Formatting Strings Pin
Spanky321-Mar-04 21:12
Spanky321-Mar-04 21:12 
GeneralRe: Formatting Strings Pin
Heath Stewart22-Mar-04 3:09
protectorHeath Stewart22-Mar-04 3:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.