473,394 Members | 1,887 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.

Need help with forms.

I am currently trying to program a game with multiple forms. As of now I have it hide the main form that loads when the program is executed. I am having difficulties getting this form to be unhidden when the user clicks the button to return to the main form. Here is snippets of the code i have so far:
Main Form
Me.Hide()
Dim Set1 As New Set1
Set1.ShowDialog()
That part works fine. The main form is hidden and they can use Set1 correctly.
Here is where the problem comes in...
Set1
Me.Close()
Form1.ShowDialog()

The main form is called Form1 in design and it tells me, "Reference to a non-shared member requires an object referance."

Any help would be appreciated.
May 8 '07 #1
2 1077
I am currently trying to program a game with multiple forms. As of now I have it hide the main form that loads when the program is executed. I am having difficulties getting this form to be unhidden when the user clicks the button to return to the main form. Here is snippets of the code i have so far:
Main Form
Me.Hide()
Dim Set1 As New Set1
Set1.ShowDialog()
That part works fine. The main form is hidden and they can use Set1 correctly.
Here is where the problem comes in...
Set1
Me.Close()
Form1.ShowDialog()

The main form is called Form1 in design and it tells me, "Reference to a non-shared member requires an object referance."

Any help would be appreciated.
in VB.NET everything treated as object.
So, when you call form1.showdialog() ,you do not create object for Form1. i.e why the error occur.
I just change the code. Please Check it.
Expand|Select|Wrap|Line Numbers
  1.        dim tmpMain as new Form1
  2.         tmpMain.ShowDialog()
  3.         Me.Close()
  4.  
if u r problem has been solved .then Plz make an End of Tag. Thank U.
May 8 '07 #2
Dököll
2,364 Expert 2GB
It looks like:

Expand|Select|Wrap|Line Numbers
  1. ....part of your code here
  2.  
  3. Unload Me
  4. Form1.Show
  5.  
  6. End
  7.  
  8.  
Should work here. Have you tried that?

Dököll
May 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Trey | last post by:
I have a DataTable with a integer field called SortOrder. This table is loaded with and XML file. I have this table in a DataView and I set the RowFilter to filter some row, then I change the...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
2
by: Susan Bricker | last post by:
Greetings. Before I begin, I have been stuck on this problem for about a 5 days, now. I have tried and just seem to be not getting anywhere. I know that the explanation is lengthy, but I am a...
5
by: MFC | last post by:
Ok, after three C# books, (C# How to Program, Programming in the Key of C#, and C# Weekend Crash Course) and three weeks, I believe I have tried everything to make a certain form function...
2
by: pv | last post by:
Hi everyone, I need help with following scenario, please: Users are accessing same web server from intranet (users previously authenticated in Active Dir) and from extranet (common public...
3
by: chris | last post by:
Hallo, I am in need of a replacement for the Microsoft Visual Studio .NET. The reason is quiet simple. I develop forms which are used on different microsoft windows platform, and one...
3
by: Noremac | last post by:
My google skills must be dwindling. I am trying to determine how in ASP.NET 2.0 I can get the ReturnUrl querystring variable in Forms Authentication to contain the absolute url. Just like others...
11
by: Peted | last post by:
Im using c# 2005 express edition Ive pretty much finished an winforms application and i need to significantly improve the visual appeal of the interface. Im totaly stuck on this and cant seem...
15
by: active | last post by:
Below is a small but complete program that appears to show you can't retrive a Palette from the clipboard. This is true whether the palette is placed on the clipboard by Photoshop or Photoshop...
5
by: Thelma Roslyn Lubkin | last post by:
I am still having trouble trying to use a popup form to allow user to set filters for the main form. The main form is based on a single table. The popup contains 5 listboxes, so the user can...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.