Getting a simple start in programming with .NET 3.0.
This article will help those, who are new in .NET 3.0 programming, and are not familiar very well with .NET 3.0. You can start from here with to do this type of simple programming. This is the start, we will learn more about .NET 3.0 programming in next. Here working with .NET 3.0 is very interesting. In .NET 3.0 we can do programming in a new way. Here animation is the most important future of .NET 3.0. XAML plays a vital role in .NET 3.0 Programming.
In this article I am showing that, how we can add two numbers in .net 3.0 Application. Firstly we have to design our window. Here we have to set our control with Margin property. Here margin property plays an important role in designing. We have to give four values for margin. First value is for Left align, Second value for Top align, Third value is for Right align and fourth value is for Bottom align. Here in .NET 3.0 designing the window is totally different from designing the window in ASP.NET 2.0.
Step 1:
Design a window, add three labels, add three textbox, add a Button. Set the margin property. Where you want to show these controls set the margin property according your design as you want to your Window look.
The Window1.xaml code will be look like as:
<Window x:Class="WindowsApplication4.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="WindowsApplication4" Height="300" Width="300" >
<Grid>
<TextBox Height="25" Margin="105,27,11,0" Name="textBox1" VerticalAlignment="Top"></TextBox>
<TextBox Margin="105,65,11,0" Name="textBox2" Height="25" VerticalAlignment="Top"></TextBox>
<Button Height="25" Margin="13,106,11,0" Name="button1" VerticalAlignment="Top" Click="button1_click">SUM</Button>
<TextBox Height="25" Margin="105,0,11,99" Name="textBox3" VerticalAlignment="Bottom"></TextBox>
<Label Height="25" HorizontalAlignment="Left" Margin="2,25,0,0" Name="label1" VerticalAlignment="Top" Width="101">Enter a no.</Label>
<Label Height="24" HorizontalAlignment="Left" Margin="3,66,0,0" Name="label2" VerticalAlignment="Top" Width="101">Enter Second No.</Label>
<Label Height="25" HorizontalAlignment="Left" Margin="15,0,0,97" Name="label3" VerticalAlignment="Bottom" Width="87">Sum of No.</Label>
</Grid>
</Window>
The window will become look like as:

Figure 1: The designing Window
Step 2:
Now the second step comes to do the code. Here we are going to add two numbers so we used here two TextBox to take the two numbers from the user. On the click event (Of button) we want to show the sum of these two numbers in a third TextBox. So we used here Button property click. The Window1.xaml.cs will be.
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace WindowsApplication4
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : System.Windows.Window
{
public Window1()
{
InitializeComponent();
}
void button1_click(object source, System.EventArgs e)
{
int a, b, c;
a = Int32.Parse(textBox1.Text);
b = Int32.Parse(textBox2.Text);
c = a + b;
textBox3.Text = c.ToString();
}
}
}
Output:

Figure 2: The running application
Summary:
This article will help to understand the basic of .NET 3.0 programming. In next article we will learn more about .NET 3.0 programming.