Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB 6.0 >>> VB.NET / October 2004

Tip: Looking for answers? Try searching our database.

Showing Forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris O. - 03 Oct 2004 19:26 GMT
What's the Visual Basic.NET equivalent to VB6's Form.Show command?
Herfried K. Wagner [MVP] - 03 Oct 2004 20:41 GMT
"Chris O." <coz1978@sbcglobal.net> schrieb:
> What's the Visual Basic.NET equivalent to VB6's Form.Show
> command?

\\\
Dim f As FooForm()
f.Show()
///

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/

Chris O. - 03 Oct 2004 20:50 GMT
Great, thanks. :)
> "Chris O." <coz1978@sbcglobal.net> schrieb:
> > What's the Visual Basic.NET equivalent to VB6's Form.Show
[quoted text clipped - 4 lines]
> f.Show()
> ///
Chris O. - 04 Oct 2004 00:10 GMT
When I try this, I get,
'show' is not a member of 'System.Array'.

Here's the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim f As Form1()

f.show()

End Sub

in the solution explorer, my form name is form1.

> Great, thanks. :)
> > "Chris O." <coz1978@sbcglobal.net> schrieb:
[quoted text clipped - 5 lines]
> > f.Show()
> > ///
Jay B. Harlow [MVP - Outlook] - 04 Oct 2004 02:36 GMT
Chris,
You defined f to be an array of Form1, if you want f to be a single
instance, do not include the () after Form1.

Also you may want to create an instance of Form1 before you attempt to show
it.

Something like:

> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
[quoted text clipped - 4 lines]
>
> End Sub

NOTE: When you are creating an instance (New Form1) you can either include
or exclude the parentheses.

   Dim f As New Form1()
   f.show()

There is also a ShowDialog that will show the form Modal (wait for the form
to be closed). Form.Show shows the form modeless, meaning both forms
continue being input capable. ShowDialog also returns one of the
DialogResult values so you can tell if the user clicked the Ok, Cancel or
other "special" buttons on your dialog box (form).

   Dim f As New Form1()
   Dim result As DialogResult
   result = f.ShowDialog()

Hope this helps
Jay

> When I try this, I get,
> 'show' is not a member of 'System.Array'.
[quoted text clipped - 20 lines]
>> > f.Show()
>> > ///
Herfried K. Wagner [MVP] - 04 Oct 2004 10:32 GMT
Errata:

> \\\
> Dim f As FooForm()

... should read '... As New FooForm()'.  Sorry for providing the wrong code.

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.