p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > C# and C > C# 1.0 > C#
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

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!


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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 .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HIDE/SHOW pallone Javascript How-To 11 April 16th, 2007 11:24 AM
How to hide control and show no space? rsearing ASP.NET 2.0 Basics 3 March 18th, 2007 10: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
Show/Hide in a DataGrid bmains ASP.NET 1.1 1 July 29th, 2004 04:16 PM



All times are GMT -4. The time now is 06:51 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc