Click here to Skip to main content
15,888,006 members
Home / Discussions / C#
   

C#

 
AnswerRe: Block parent form Pin
Dominik Reichl22-Aug-09 6:18
Dominik Reichl22-Aug-09 6:18 
AnswerRe: Block parent form Pin
Natural_Demon22-Aug-09 6:19
Natural_Demon22-Aug-09 6:19 
GeneralRe: Block parent form Pin
Dominik Reichl22-Aug-09 6:49
Dominik Reichl22-Aug-09 6:49 
GeneralRe: Block parent form Pin
Natural_Demon22-Aug-09 7:07
Natural_Demon22-Aug-09 7:07 
AnswerRe: Block parent form Pin
Xmen Real 22-Aug-09 7:09
professional Xmen Real 22-Aug-09 7:09 
GeneralRe: Block parent form Pin
Dominik Reichl22-Aug-09 8:17
Dominik Reichl22-Aug-09 8:17 
AnswerRe: Block parent form Pin
Saksida Bojan22-Aug-09 12:02
Saksida Bojan22-Aug-09 12:02 
GeneralRe: Block parent form Pin
Luc Pattyn22-Aug-09 13:29
sitebuilderLuc Pattyn22-Aug-09 13:29 
Saksida Bojan wrote:
Moddaly and non moddaly means only that it runs either in diffrent or same thread


I don't think so. It means they use different message pumps, however all message pumps are executed (one at a time) by one and only one thread.

Here is an experiment to prove it:
- create main form Form1 with a ListBox and a Button; it will be shown modelessly;
- create Form2 with a ListBox and a Button; it will be shown modally;
- add the following to Form1:
public partial class Form1 : Form {
    int count;

    public Form1() {
        InitializeComponent();
    }

    public void log(string s) {
        lb.Items.Add(s);
    }

    private void button1_Click(object sender, EventArgs e) {
        log("Thread ID="+Thread.CurrentThread.ManagedThreadId);
        Form2 f=new Form2();
        f.ShowDialog();
    }

    protected override void WndProc(ref Message m) {
        count++;
        if (count<5) log("Thread ID="+Thread.CurrentThread.ManagedThreadId);
        base.WndProc(ref m);
    }
}


- add basically the same code to Form2 (without new Form2/ShowDialog)
- run, click button, see all thread IDs, on second form, click button, see all thread IDs equal to the former ones.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

QuestionPermanent connection with webserver Pin
Xmen Real 22-Aug-09 3:15
professional Xmen Real 22-Aug-09 3:15 
AnswerRe: Permanent connection with webserver Pin
Natural_Demon22-Aug-09 6:30
Natural_Demon22-Aug-09 6:30 
GeneralRe: Permanent connection with webserver Pin
Xmen Real 22-Aug-09 7:04
professional Xmen Real 22-Aug-09 7:04 
GeneralRe: Permanent connection with webserver Pin
Dave Kreskowiak22-Aug-09 7:38
mveDave Kreskowiak22-Aug-09 7:38 
GeneralRe: Permanent connection with webserver Pin
Xmen Real 22-Aug-09 7:40
professional Xmen Real 22-Aug-09 7:40 
GeneralRe: Permanent connection with webserver Pin
Natural_Demon22-Aug-09 8:37
Natural_Demon22-Aug-09 8:37 
GeneralRe: Permanent connection with webserver Pin
Xmen Real 22-Aug-09 16:12
professional Xmen Real 22-Aug-09 16:12 
GeneralRe: Permanent connection with webserver Pin
Natural_Demon23-Aug-09 1:22
Natural_Demon23-Aug-09 1:22 
GeneralRe: Permanent connection with webserver Pin
Natural_Demon22-Aug-09 8:51
Natural_Demon22-Aug-09 8:51 
QuestionIHTMLElement onclick event method call Pin
yogesh_softworld12322-Aug-09 3:07
yogesh_softworld12322-Aug-09 3:07 
Questionfilling a form on internet ! Pin
sajjy22-Aug-09 2:31
sajjy22-Aug-09 2:31 
AnswerRe: filling a form on internet ! Pin
Natural_Demon22-Aug-09 9:12
Natural_Demon22-Aug-09 9:12 
AnswerRe: filling a form on internet ! Pin
jbc123-Aug-09 2:26
jbc123-Aug-09 2:26 
QuestionWhat is the best way to create background application? Pin
bonzaiholding22-Aug-09 0:39
bonzaiholding22-Aug-09 0:39 
AnswerRe: What is the best way to create background application? Pin
Saksida Bojan22-Aug-09 0:47
Saksida Bojan22-Aug-09 0:47 
GeneralRe: What is the best way to create background application? Pin
bonzaiholding22-Aug-09 0:55
bonzaiholding22-Aug-09 0:55 
GeneralRe: What is the best way to create background application? Pin
Saksida Bojan22-Aug-09 0:58
Saksida Bojan22-Aug-09 0:58 

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.