|
|
 |
| 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.
|
 |

November 1st, 2006, 10:53 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|

November 2nd, 2006, 10:44 AM
|
|
Authorized User
|
|
Join Date: Feb 2006
Location: Bluefields, , .
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
you must initialize a new object with the studentarea form in the way:
StudentArea frm = new StudentArea();
frm.Show();
MAKO - "El super simio"
|

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
|
|
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 .
|

November 3rd, 2006, 11:07 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanxs for all your reply. I have done it
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |