Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8661595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:32:03+00:00 2026-06-12T16:32:03+00:00

I am trying to write my own custom TextBox control in Silverlight 5. I

  • 0

I am trying to write my own custom TextBox control in Silverlight 5.

I already have successfully written a custom label control, which I can reuse in my project.

The XAML and the code behind for the label control look like this.

The following code does work for me:

<sdk:Label 

x:Class="Gui.CustomControls.LabelControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sw="clr-namespace:System.Windows;assembly=System.Windows"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
mc:Ignorable="d"
d:DesignHeight="25" d:DesignWidth="125">

<Grid x:Name="LayoutRoot" Background="White">

</Grid>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
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 Gui.CustomControls
{
    public partial class LabelControl : System.Windows.Controls.Label
    {
        public LabelControl()
        {
            InitializeComponent();

        }


    }
}

Now I want to do the same for a TextBox – writing my own custom TextBox Control.
The code for the TextBox looks like this: As you may see, it is nearly the same thing

<sdk:TextBox 

    x:Class="Gui.CustomControls.TextBoxControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sw="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    mc:Ignorable="d"
    d:DesignHeight="25" d:DesignWidth="125">

    <Grid x:Name="LayoutRoot" Background="White">

    </Grid>
</sdk:TextBox>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
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 Gui.CustomControls
{
    public partial class TextBoxControl : System.Windows.Controls.TextBox
    {
        public TextBoxControl()
        {
            InitializeComponent();

        }



    }
}

While buliding the solution the following error occurs:

“The tag ‘TextBox’ does not exist in XML namespace ‘http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk'&#8221;

As the textbox control seems to live in the System.Windows.Controls.TextBox Namespace, I tried different namespaces in the XAML, but nothing worked.

My question is:

Which namespace do I have to use, to build this custom textbox?

If it’s not a namespace problem, what am I missing?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:32:04+00:00Added an answer on June 12, 2026 at 4:32 pm

    It’s not sdk:TextBox, just TextBox (i.e. http://schemas.microsoft.com/winfx/2006/xaml/presentation, which is the default xmlns in most XAML files). While oddly not documented on the Silverlight TextBox class, this is documented on the .NET 4.5 TextBox class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well im trying to write my own custom control extender but i can't get
I'm trying to write my own custom View and I have problem with LayoutParams
I'm trying to write my own protocol so that multiple servers can pass data
I have been trying to write my own diff3 wrap script for SVN and
I'm trying to write my own Custom Validation attribute but I'm having some problems.
I'm trying to write a custom MarkupExtension that allows me to use my own
I have a CKEditor custom plugin I'm trying to write, but need some help
I am trying to write my own JVM. Can you point me to some
I'm trying to derive from the Silverlight Panel control to add some custom logic
I have a custom control of class DottedCanvas inherited from Canvas, which contains some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.