Results 1 to 5 of 5

Thread: Display form from background thread?!

  1. #1

    Thread Starter
    Addicted Member ShIzO's Avatar
    Join Date
    Apr 1999
    Location
    Bartlett, IL
    Posts
    189

    Angry Display form from background thread?!

    Hey guys, i'm having really hard time displaying new form from the
    inside of Event hadler that runs within the process of the caller.
    the new form shows but i cant focus on it and it just hungs there.

    Private Sub on_PrivateMessage(ByVal vUserName As String, ByVal
    vMessage As String) Handles objC.PrivateMessage
    Dim lForm As frmPrivate

    lForm = New frmPrivate
    lForm.gNick = vUserName
    lForm.DisplayMessage(vUserName, vMessage)
    lForm.Visible = True

    End Sub

    if i use lForm.ShowDialog() then it paints okay and i can interact
    with it but then the main form stops processing messages...

    Please help.
    www.HardFind.com -buy/sell/trade your used hardware.

  2. #2
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    yeah i posted something like this earlier, when using form.showdialog it works fine, but with form.show program hangs! very weird! even created the form asyn using delegates, but still having the same problem!
    Last edited by persianboy; Sep 28th, 2003 at 01:34 PM.

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try :
    VB Code:
    1. Application.Run(yourform)

  4. #4
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    what does that do?

    and in what namespace is this calss located???

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    In this namespace .
    VB Code:
    1. Imports System.Windows.Forms

    What is it for ? Just stop the cursor on that word and press F1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width