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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:00:39+00:00 2026-05-29T20:00:39+00:00

Apologies if the answer to this question is completely obvious but it has me

  • 0

Apologies if the answer to this question is completely obvious but it has me stumped at the moment. Why will the textboxes in this example not receive focus? If I use vanilla textboxes without the control template the focus works fine.

<StackPanel>
        <Label Name="lblChartTitle"
            Content="{x:Static res:Strings.ChartOptionsTitlesControlView_Label_Title}" />
            <TextBox Name="txtChartTitle" 
                     Text="{Binding Path=ChartTitle}" 
                     MaxLength="255"
                     KeyboardNavigation.TabIndex="1"
                     Template="{DynamicResource ctTextBox3DInset}"
                     />
        <Label Name="lblChartCategoryXAxis"
            Content="{x:Static res:Strings.ChartOptionsTitlesControlView_Label_CategoryXAxis}" />
            <TextBox Name="txtChartCategoryXAxis" 
                     Text="{Binding Path=CategoryXAxis}" 
                     MaxLength="255" 
                     KeyboardNavigation.TabIndex="2"
                     Template="{DynamicResource ctTextBox3DInset}"
                     />
        <Label Name="lblChartValueYAxis"
            Content="{x:Static res:Strings.ChartOptionsTitlesControlView_Label_ValueYAxis}" />
            <TextBox Name="txtChartValueYAxis" 
                     Text="{Binding Path=ValueYAxis}" 
                     MaxLength="255"
                     KeyboardNavigation.TabIndex="3"
                     Template="{DynamicResource ctTextBox3DInset}"
                     />
    </StackPanel>

<ControlTemplate x:Key="ctTextBox3DInset" TargetType="TextBox">
            <Border 
                Style="{StaticResource BorderStyle3DInsetBlack}"
                Margin="0,0,0,5">
                <Border Style="{StaticResource BorderStyle3DInsetWhite}">
                    <Border Style="{StaticResource BorderStyle3DInset}">
                        <TextBox
                            TabIndex="{TemplateBinding TabIndex}"
                            BorderThickness="0"/>
                    </Border>
                </Border>
            </Border>
        </ControlTemplate>
  • 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-29T20:00:41+00:00Added an answer on May 29, 2026 at 8:00 pm


    Because when you apply the ControlTemplate, you are actually creates another TextBox.. So the focus is not set to the TextBox within your ControlTemplate.

    Edit:

    What you need to use is actually <ContentPresenter/>:

    <ContentPresenter/>
    

    instead of creating a TextBox using

    <TextBox  TabIndex="{TemplateBinding TabIndex}" 
                            BorderThickness="0"/> 
    

    Edit 2: I think my previous answer was wrong, TextBox work differently.
    You have to use <ScrollViewer Margin="0" x:Name="PART_ContentHost"/> for TextBox, PART_ContentHost is a special name for assign an element as content host. And must be use with ScrollViewer or an AdornerDecorator.

    Here is the reference

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

Sidebar

Related Questions

Apologies for the recursive nature of this question but the chosen answer to a
I have a very novice question, so apologies if the answer to this is
Greetings, Apologies in advance that I have not researched this toughly enough to answer
Apologies if this is too ignorant a question or has been asked before. A
Apologies if this is a simple question but googling hasn't been able to help
Apologies for the seeming obviousness of this question, but for whatever reason I haven't
my apologies if this question doesn't make much sense, but I'm new(ish) to Actionscript,
My apologies for the extremely basic question, I think I know the answer but
Apologies if this question has been answered before. Though the answers I've seen look
Apologies if this question is already posted. I didn't find the answer i was

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.