Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 1st, 2006, 10:53 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to show/hide forms ?

i am trying to access StudentArea.cs form and hiding the current one Index.cs. Beside the Button in index.cs i have written the following code:

this.Close();
StudentArea.Show();

i am getting the following error:

C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\online_exam_csharp\index.cs(118): An object reference is required for the nonstatic field, method, or property 'System.Windows.Forms.Control.Show()'

Any Idea!


Reply With Quote
  #2 (permalink)  
Old November 2nd, 2006, 10:44 AM
Authorized User
 
Join Date: Feb 2006
Location: Bluefields, , .
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MAKO
Default

you must initialize a new object with the studentarea form in the way:

StudentArea frm = new StudentArea();
frm.Show();



MAKO - "El super simio"
Reply With Quote
  #3 (permalink)  
Old November 2nd, 2006, 11:55 AM
Authorized User
 
Join Date: Jul 2006
Location: DongYing, , China.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to abeen
Default


    the nonstatic field must be initialize a new object before used .
You referenced the nonstatic field,you must initialize a new object before used the nonstatic field .
  So the code is:
    StudentArea frm = new StudentArea();
    frm.Show();

 ABeen
  Life is not fair,get used to it .
Reply With Quote
  #4 (permalink)  
Old November 3rd, 2006, 11:07 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanxs for all your reply. I have done it

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HIDE/SHOW pallone Javascript How-To 11 April 16th, 2007 10:24 AM
How to hide control and show no space? rsearing ASP.NET 2.0 Basics 3 March 18th, 2007 09:39 AM
show/hide row(s) eugz Beginning PHP 0 March 19th, 2006 10:10 PM
How Do I SHOW and HIDE Windows Forms in VB.NET? kegeorge0819 VB How-To 1 March 10th, 2005 03:49 AM



All times are GMT -4. The time now is 07:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.