wojo Posted September 27, 2003 Posted September 27, 2003 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. Quote
*Gurus* divil Posted September 29, 2003 *Gurus* Posted September 29, 2003 You have to make sure your new form is created on the same thread as the rest of your UI. You can do this by using the Invoke method of an existing control to run a delegate of your choosing, that creates your secondary form. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.