Home All Groups Group Topic Archive Search About

How to name a thread?

Author
8 Apr 2005 2:16 AM
Brett
In form_load(), I do this
    Thread.CurrentThread.Name = "MainThread"

However, in the debugger thread window, I see:

<No Name>  appname.Classname.Form1_load   Normal  0

Why does it still have <No Name>?  Which name is that?

Thanks,
Brett

Author
8 Apr 2005 3:21 AM
Joseph MCAD
April 7, 2005

   I believe this is happening, because the line with <No Name> gets written
Before your code runs. I think that the line is written as it Starts
Form_Load and Not after the code in form_load has run. Just a theory. Good
luck!


   Joseph MCAD



Show quoteHide quote
"Brett" wrote:

> In form_load(), I do this
>     Thread.CurrentThread.Name = "MainThread"
>
> However, in the debugger thread window, I see:
>
> <No Name>  appname.Classname.Form1_load   Normal  0
>
> Why does it still have <No Name>?  Which name is that?
>
> Thanks,
> Brett
>
>
>
Author
8 Apr 2005 3:26 AM
Angel J. Hernández M.
If I write something like....

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

     System.Threading.Thread.CurrentThread.Name = "MainThread"

End Sub


I set the name for my form's main thread. Check out the attached file

Regards,


--
Angel J. Hernández M.
MCP -  MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda





Show quoteHide quote
"Brett" <no@spam.net> escribió en el mensaje
news:uyYQNE%23OFHA.3356@TK2MSFTNGP12.phx.gbl...
> In form_load(), I do this
>    Thread.CurrentThread.Name = "MainThread"
>
> However, in the debugger thread window, I see:
>
> <No Name>  appname.Classname.Form1_load   Normal  0
>
> Why does it still have <No Name>?  Which name is that?
>
> Thanks,
> Brett
>
>

[attached file: Snapshot.JPG]