|
-
Dec 23rd, 2002, 07:39 AM
#1
Thread Starter
New Member
Load forms through Sub Main
Hi,
We have developed a Windows Application using vb.net. In this project, we have
a public Module file and couple of Windows forms. we have a procedure named Main in the
module file and we would like to load a form through this sub-routine. The code snippet
is given below for your reference.
Public Module Module1
Public obj_frm_Test As New frmTest()
Public Sub Main()
obj_frm_Test.Show()
End Sub
End Module
In frmTest, we have few windows controls to do the required processing. We set
Sub Main as the startup objeect using project properties dialog box. Whn we execute
our project now, frmTest comes to the foreground and it gets unloaded automatically by itself.
Our understanding about this is, when Sub Main procedure goes out of scope, objects created
inside this sub routine is destoryed automatically.
Here, instead of Show(), when we use ShowDialog(), form stays in the foreground, we expect
Show() function to behave in the similar way. The same piece of code when we execut it from
Visual Basic 6.0, it works as we expect.
Can you tell us what needs to be corrected in the above code, we look forward
for your reply, thank you.
Regards,
Deva.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|