473,394 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Simple Question -- Switching Forms

I switched from VB6 to VB.net some time ago, and I cannot figure out how
to close FormA and open FormB.

I have 2 forms "Main" and "Start". To switch it should just be:

Me.Hide
Start.Show

However, this does not work. It says that "reference to a non-shared
member requires and object reference"

Thanks,
*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #1
6 913
A.,

Dim frm As New Form2

Me.Hide()
frm.Show()

Kerry Moorman
"A. Gaubatz" wrote:
I switched from VB6 to VB.net some time ago, and I cannot figure out how
to close FormA and open FormB.

I have 2 forms "Main" and "Start". To switch it should just be:

Me.Hide
Start.Show

However, this does not work. It says that "reference to a non-shared
member requires and object reference"

Thanks,
*** Sent via Developersdex http://www.developersdex.com ***

Nov 21 '05 #2
You need to create an instance of "Start", as Start is a class of form, not
an instance of one,

Try this:

Dim theStart as New Start

Start.Show ()
Me.Hide ()

"A. Gaubatz" <an*******@gmail.com> wrote in message
news:eC**************@TK2MSFTNGP09.phx.gbl...
I switched from VB6 to VB.net some time ago, and I cannot figure out how
to close FormA and open FormB.

I have 2 forms "Main" and "Start". To switch it should just be:

Me.Hide
Start.Show

However, this does not work. It says that "reference to a non-shared
member requires and object reference"

Thanks,
*** Sent via Developersdex http://www.developersdex.com ***

Nov 21 '05 #3
Thanks, for the help!

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #4


"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:db*******************@news.demon.co.uk...
You need to create an instance of "Start", as Start is a class of form,
not an instance of one,

Try this:

Dim theStart as New Start

Start.Show ()
Me.Hide ()


one of the best features of VB.NET if you ask me.
Nov 21 '05 #5
"Rick Mogstad" <Ri**********@GMail.NOSPAM.com> wrote in news:eI9P$eJiFHA.3300
@TK2MSFTNGP15.phx.gbl:
one of the best features of VB.NET if you ask me.


What feature is that?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
Nov 21 '05 #6
A. Gaubatz <an*******@gmail.com> wrote in news:eC**************@TK2MSFTNGP09.phx.gbl:
I switched from VB6 to VB.net some time ago, and I cannot figure out how
to close FormA and open FormB.


http://www.codeproject.com/dotnet/Wo...thWinForms.asp

This addresses this and more regarding forms.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul Mitchell | last post by:
I have taken several individual apps that each use a dsn and combined them into one app. I was wondering if anyone has any sample code that would allow switching between odbc dsn-less connections...
5
by: Jacques Cooper | last post by:
Hello, We developed a C# application. How do you changes views within the same application window? With VC++ you changes views within the same window with the SwitchView method. TIA,
2
by: Johann Blake | last post by:
The following is a bug I have discovered using tab pages and threads and I am looking for a workaround. Create a new Windows Forms application and add a tab control with two tab pages. Add a...
4
by: Jeremy Holt | last post by:
Hi, In a windows.forms application I would BeginInvoke a delegate on the UI thread to collect data from a database. When the call returns to the AsyncCallback, if the Control.InvokeRequired =...
2
by: AllenL | last post by:
Ever since I've been using objects with VB I've instantiated the business object from the form; the business object then creates/destroys data access layer objects as needed. The business object...
3
by: Simon Verona | last post by:
I have a parent form which contains a toolbar. The toolbar controls the loading and switching to of MDI child forms. The code for the toolbar click event and one of the subroutines that loads...
1
by: SamSpide | last post by:
Hi all, I have a moderate-side 'Windows Form Application' (C++) project, with several forms. For some reason switching between code & designer views (right-click ;view code' or 'view...
4
by: K Viltersten | last post by:
We have a project working well today and it's developed on VS2005. Since we're planing to switch to VS2008 in a soon future, i've been trying to move the project to VS2008 Express (Web...
2
by: Olrik | last post by:
I'm having a problem with c# when switching forms. It seems that when i switch from one form to the other they always call Form_load, which I don't want. Im using form.show() and form.hide() so I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.