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 4625596
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:17:44+00:00 2026-05-22T03:17:44+00:00

Totally new to custom control creation in Silverlight. I’m wanting a custom control that

  • 0

Totally new to custom control creation in Silverlight.

I’m wanting a custom control that inherits from a TextBox control. I’ve found plenty of tutorials but they all do something like watermarked text or other attached properties. My goal is only to manipulate text at time of entry using the KeyUp event, so visually my TextBox is no different from a standard TextBox.

I created a class file and inherited from TextBox, but at run-time the textbox doesn’t display. From what I can gather I need a themes/generic.xaml file, but all of samples I’ve seen include styles for the additional properties, and in my ignorance I don’t know what to change and/or remove.

I’m hoping someone can point me to a generic plain-jane TextBox style definition or a tutorial of such.

  • 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-05-22T03:17:45+00:00Added an answer on May 22, 2026 at 3:17 am

    What you described should work, I just tried the following and the TextBoxEx renders just fine:

    public class TextBoxEx : TextBox
    {
      protected override void OnKeyUp(KeyEventArgs e)
      {
        base.OnKeyUp(e);
      }
    }
    

    You do not need to add a generic.xaml file. This file is used to provide a template which defines the look of your control. You specify the default look of your control by setting the following property:

    DefaultStyleKey = typeof(MyControl);
    

    However, as the above TextBoxEx does not set this property, it uses the value inherited from TextBox and hence it inherits the same template (i.e look).

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

Sidebar

Related Questions

Totally new to Capistrano. I have a local git repository that I want to
I'm totally new to AWS. I managed to have an instance that runs PHPMyAdmin.
I'm totally new in OpenCV so hopefully that's not a too stupid question. As
I´m totally new to Powershell and wanted to write a script that deletes all
I'm totally new to Win Forms. I see that the vertical scroll bar on
Totally new to programming so kindly excuse the silly question. I have this URL
im totally new when it comes to trying to make HTML code. I was
Im totally new to regex. I need your help. What is the regex function
I'm totally new to this WCF Services thing so any guidelines would be greatly
So I'm totally new to Haskell, hope it doesn't show too much. By any

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.