seinkraft
Member
- Joined
- Sep 28, 2008
- Messages
- 19
- Programming Experience
- 5-10
Hi, I've the next problem.
I've an app that starts to work from a module wich should load a form an do other things with a class library who raise an event an the form shoud cath it.
The problem is that applicarion.run(frmMain) displays the form in the same thread the the code stops work while the form is open. And I need that the app works in this way because the user need to send files to the app using args and this avoid that the app init another instance of it (in other code) and update the form with the info when the event is raised.
Please help
Module
Class
Form
The code is also attached without compiled files.
I've an app that starts to work from a module wich should load a form an do other things with a class library who raise an event an the form shoud cath it.
The problem is that applicarion.run(frmMain) displays the form in the same thread the the code stops work while the form is open. And I need that the app works in this way because the user need to send files to the app using args and this avoid that the app init another instance of it (in other code) and update the form with the info when the event is raised.
Please help
Module
VB.NET:
Module moMain
Public my_Class As New ClassDll.clsMain
Public Sub main()
Application.Run(frmMain)
Debug.WriteLine("Form Loaded")
my_Class.DoSomething()
End Sub
End Module
Class
VB.NET:
Public Class clsMain
Public Event EventRaise()
Public Sub DoSomething()
RaiseEvent EventRaise()
End Sub
End Class
Form
VB.NET:
Public Class frmMain
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AddHandler my_Class.EventRaise, AddressOf raised_from_class
End Sub
Public Sub raised_from_class()
MsgBox("event raised")
End Sub
End Class
The code is also attached without compiled files.
Attachments
Last edited by a moderator: