U were clear with the use of PrevInstance property..as killer said i always use a startup form..i just wanted to know why programmers use sub main()? Is there any advantage in using it?
To be honest, I think it's largely a matter of personal preference.
On the other hand, a form is really just a user interface element (similar in many ways to a text box or scroll bar). So in some ways it seems more logical to start the actual program and have it display whatever forms are appropriate, rather than starting up a form and then having other things happen. I mean, you wouldn't expect to run a text box and have it create a form to hold it, and so on.
Besides, there may be cases where your application doesn't include a form at all. For instance, I sometimes write a "quick and dirty" program to read a text file, make some change, and write out a new one. For something that only I will run, and which will take maybe five seconds, a user interface is just a waste of time. It's simpler to just write the routine to do the work, and run it.