|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sub Main Ends so does the applicationAdmittedly, I am new to VB.NET
I have some real simple code that I am trying to run in VB.NET Friend Module xxx Friend F1 As Form1 ----------------- Public Sub Main() F1 = New Form1 Form1.Show() End Sub All I am trying to do is show the form. However, at the End Sub statement the form closes..... I am confused. Any ideas? if you want to use forms, create a Windows Application, at the end of the
sub, the program terminates, so if you want to use forms (usually) you want to use a Windows Application -- -iwdu15 Use Application.Run(Form1) instead of Form1.Show()
Jim Wooley http://devauthority.com/blogs/jwooley/default.aspx Show quoteHide quote > Admittedly, I am new to VB.NET > > I have some real simple code that I am trying to run in VB.NET > > Friend Module xxx > Friend F1 As Form1 > ----------------- > Public Sub Main() > > F1 = New Form1 > > Form1.Show() > > End Sub > > All I am trying to do is show the form. However, at the End Sub > statement the form closes..... I am confused. Any ideas? > Hello Jim,
Actually using the OP's original code fragment it would be Application.Run(F1).. or, optionally Application.Run(new Form1) -Boo Show quoteHide quote > Use Application.Run(Form1) instead of Form1.Show() > > Jim Wooley > http://devauthority.com/blogs/jwooley/default.aspx >> Admittedly, I am new to VB.NET >> >> I have some real simple code that I am trying to run in VB.NET >> >> Friend Module xxx >> Friend F1 As Form1 >> ----------------- >> Public Sub Main() >> F1 = New Form1 >> >> Form1.Show() >> >> End Sub >> >> All I am trying to do is show the form. However, at the End Sub >> statement the form closes..... I am confused. Any ideas? >> RRowe,
Just as addition, Did you know that a VBNet mainform has an inbuild submain with an application run as long as you have not done that yourself. Cor Show quoteHide quote "rrowe" <rr***@hotmail.com> schreef in bericht news:%23l3lWF1rGHA.3380@TK2MSFTNGP04.phx.gbl... > Admittedly, I am new to VB.NET > > I have some real simple code that I am trying to run in VB.NET > > Friend Module xxx > Friend F1 As Form1 > ----------------- > > Public Sub Main() > > F1 = New Form1 > > Form1.Show() > > End Sub > > All I am trying to do is show the form. However, at the End Sub > statement > the form closes..... I am confused. Any ideas? > Cor Ligthert [MVP] wrote:
> RRowe, But if you want to do things like enable visual styles, read a config> > Just as addition, > > Did you know that a VBNet mainform has an inbuild submain with an > application run as long as you have not done that yourself. > > Cor file or manually display a splash screen, you will need to make it. Show quoteHide quote > > "rrowe" <rr***@hotmail.com> schreef in bericht > news:%23l3lWF1rGHA.3380@TK2MSFTNGP04.phx.gbl... > > Admittedly, I am new to VB.NET > > > > I have some real simple code that I am trying to run in VB.NET > > > > Friend Module xxx > > Friend F1 As Form1 > > ----------------- > > > > Public Sub Main() > > > > F1 = New Form1 > > > > Form1.Show() > > > > End Sub > > > > All I am trying to do is show the form. However, at the End Sub > > statement > > the form closes..... I am confused. Any ideas? > > > But if you want to do things like enable visual styles, read a config Or maybe as showed on this page?> file or manually display a splash screen, you will need to make it. > http://msdn2.microsoft.com/en-us/library/ms233841.aspx Cor <za***@construction-imaging.com> schreef in bericht Show quoteHide quote news:1153832848.890681.129930@m73g2000cwd.googlegroups.com... > > Cor Ligthert [MVP] wrote: >> RRowe, >> >> Just as addition, >> >> Did you know that a VBNet mainform has an inbuild submain with an >> application run as long as you have not done that yourself. >> >> Cor > > But if you want to do things like enable visual styles, read a config > file or manually display a splash screen, you will need to make it. > >> >> "rrowe" <rr***@hotmail.com> schreef in bericht >> news:%23l3lWF1rGHA.3380@TK2MSFTNGP04.phx.gbl... >> > Admittedly, I am new to VB.NET >> > >> > I have some real simple code that I am trying to run in VB.NET >> > >> > Friend Module xxx >> > Friend F1 As Form1 >> > ----------------- >> > >> > Public Sub Main() >> > >> > F1 = New Form1 >> > >> > Form1.Show() >> > >> > End Sub >> > >> > All I am trying to do is show the form. However, at the End Sub >> > statement >> > the form closes..... I am confused. Any ideas? >> > > |
|||||||||||||||||||||||