TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
pppp pppp
NA
3
0
I need share variables between various classes
Jan 6 2009 10:08 AM
I had this three classes:
Start.cs:
---------
using System;
using System.Windows.Forms;
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
static void Main(string[] args)
{
Uruchom();
}
public static void Uruchom()
{
Book written = new Book();
Book bought = new Book();
written.Author = "Test";
}
}
}
Variables.cs:
-------------
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
public class Book
{
public string Title;
public string Author;
public short YearPublished;
public int NumberOfPages;
public char CoverType;
}
}
Checking.cs:
------------
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
private class Outside
{
private void SomethingElse()
{
Book written = new Book();
Console.WriteLine("Author: {0}",written.Author);
}
}
I want to see and edit variables from class Book in other classes. I want to do as simplest as possible. I am competely newbie in Visual Studio 2005 C# programming.
Reply
Answers (
2
)
TRee VIew COntrol- Help needed
RichTextBox Teasing With its behaviour- Pls help-