Getting Started

Coordinator
Sep 6, 2007 at 11:18 PM
Edited Sep 6, 2007 at 11:48 PM

Need help getting started with nScreen?


Getting started with nScreen is very simple. To create your first nScreen application just follow these easy steps:
  1. Create a new .NET class for your Screen.
  2. Inherit that class from the nScreen.Screen class.
  3. Override the OnInitialize method.
  4. In the OnInitialize method create an instance of the nScreen.Controls.Label class.
  5. Set the Text property of the Label instance.
  6. Add the Label instance to your screens Controls collection.
  7. Create your applications entry point method.
  8. From the entry point method call the ScreenApplication.Run method passing in an instance of your screen class.
  9. Compile your application and reference the nScreen.dll.
  10. Run your application!

C# Example:


using System;
using nScreen;
using nScreen.Controls;
 
namespace HelloWorldApplication
{
	internal class HelloWorld : Screen
	{
		protected override void OnInitialize()
		{
			base.OnInitialize();
 
			Label label = new Label();
 
			label.Text = "Hello World!";
 
			this.Controls.Add(label);
		}
 
		private static void Main(string[] args)
		{
			ScreenApplication.Run(new HelloWorld());
		}
	}
}