Silverlight Textbox Control
The TextBox control that is shipped with Silverlight is easy to use in your own Silverlight applications, here we have a simple example.
You need to login to Download the TextBox example, If you do not have a login you can register for free!
How to Use the TextBox Control
To use the textbox on your Silverlight page:
<UserControl x:Class="TextBoxPlus.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Canvas>
<TextBlock x:Name="userNameLabel" Canvas.Left="0" Canvas.Top="52" Text="User Name:" FontFamily="Arial" />
<TextBlock x:Name="passwordLabel" Canvas.Left="0" Canvas.Top="82" Text="Password:" FontFamily="Arial" />
<TextBox x:Name="userName" Canvas.Top="50" Canvas.Left="80" Width="150" MaxLength="20" TabIndex="0" />
<PasswordBox x:Name="password" Canvas.Top="80" Canvas.Left="80" Width="150" TabIndex="1" />
</Canvas>
</UserControl>
In your Silverlight C# code behind file you can refer to the TextBoxes using firstName and lastName.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace TextBoxPlus
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
}
}
}
Rate this:
1 Star
2 Star
3 Star
4 Star
5 Star
104 Ratings / 3.0 Average