windows form not displaying

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dayne

    #1

    windows form not displaying

    Briefly this is my problem .

    I created a windows form on a "parent thread" .. then I called a child
    thread 1 to make it visible then hide it on that same thread .. then kill
    child thread 1 ... then try to make the form visible on child thread 2 ..
    However, the form will not display either on child thread 2 or "parent
    thread" ... Any idea why this is? Please help

    DT


  • Cor Ligthert

    #2
    Re: windows form not displaying

    Dayne,

    Maybe can this sample I made a while ago help you in this.

    It is showing an extra form (two times the same) with a thread and withouth
    a thread


    I hope this helps?

    Cor
    "Dayne" <d_jermaine_t@h otmail.com>
    [color=blue]
    > Briefly this is my problem .
    >
    > I created a windows form on a "parent thread" .. then I called a child
    > thread 1 to make it visible then hide it on that same thread .. then kill
    > child thread 1 ... then try to make the form visible on child thread 2 ..
    > However, the form will not display either on child thread 2 or "parent
    > thread" ... Any idea why this is? Please help
    >
    > DT
    >
    >[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: windows form not displaying

      "Dayne" <d_jermaine_t@h otmail.com> schrieb:[color=blue]
      > I created a windows form on a "parent thread" .. then I called a child
      > thread 1 to make it visible then hide it on that same thread .. then kill
      > child thread 1 ... then try to make the form visible on child thread 2 ..
      > However, the form will not display either on child thread 2 or "parent
      > thread"[/color]

      Always show your forms in the app's main UI thread. You can use
      'Control.Invoke '/'Control.BeginI nvoke' to communicate in the thread -> UI
      direction.

      More information:

      Multithreading:

      <URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0611200 2.asp>
      <URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0816200 2.asp>
      <URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0123200 3.asp>

      <URL:http://www.devx.com/dotnet/Article/11358/>

      <URL:http://msdn.microsoft. com/library/en-us/cpref/html/frlrfSystemWind owsFormsControl ClassInvokeTopi c.asp>

      Multithreading in Visual Basic .NET (Visual Basic Language Concepts)
      <URL:http://msdn.microsoft. com/library/en-us/vbcn7/html/vaconthreadingi nvisualbasic.as p>

      Sample:

      <URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnume rator.zip>

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      Working...