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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:27:14+00:00 2026-05-18T23:27:14+00:00

I am planning to have search functionality in WPF like it happens in Google

  • 0

I am planning to have search functionality in WPF like it happens in Google Chrome browser. The sample is shown below

alt text

I have the backend code ready, but I want to have a TextBox like the one shown below – in which I can display the results also(like 0 of 0).

Also I would like to have the arrow marks for next and prev.
How do I design such a TextBox in WPF in XAML? Please guide me regarding the same.

  • 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-18T23:27:15+00:00Added an answer on May 18, 2026 at 11:27 pm

    A custom control can be created using following code:

    public class SearchTextBox : Control
    {
        public String Text
        {
            get { return (String)GetValue(TextProperty); }
            set { SetValue(TextProperty, value); }
        }
    
        // Using a DependencyProperty as the backing store for Text.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(String), typeof(SearchTextBox), new UIPropertyMetadata(null));
    
        public String SearchStatusText
        {
            get { return (String)GetValue(SearchStatusTextProperty); }
            set { SetValue(SearchStatusTextProperty, value); }
        }
    
        // Using a DependencyProperty as the backing store for SearchStatusText.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty SearchStatusTextProperty =
            DependencyProperty.Register("SearchStatusText", typeof(String), typeof(SearchTextBox), new UIPropertyMetadata(null));
    
        static SearchTextBox()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(SearchTextBox), new FrameworkPropertyMetadata(typeof(SearchTextBox)));
        }
    }
    

    Style in Generic.xaml

    <Style TargetType="{x:Type local:SearchTextBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:SearchTextBox}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <TextBox Grid.Column="0"
                                     Text="{TemplateBinding Text}" />
                            <TextBlock Grid.Column="1"
                                       Text="{TemplateBinding SearchStatusText}"></TextBlock>
                            <Button Grid.Column="2">
                                <Polyline Points="0,10 5,0 10,10"
                                          Stroke="Black"
                                          StrokeThickness="2" />
                            </Button>
                            <Button Grid.Column="3">
                                <Polyline Points="0,0 5,10 10,0"
                                          Stroke="Black"
                                          StrokeThickness="2" />
                            </Button>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    

    You will need to change it according to your needs. But this should be a good starting point.

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

Sidebar

Related Questions

I'm planning to have collection of items stored in a TCollection. Each item will
I have a RelativeLayout with different elements. I was planning to have two ListViews
As most of my content is static i was planning to have nginx to
I have a planning structure on two tables to store available slots by day,
I have a personal project I'm planning and I came to a small hurdle.
I have a client with an event planning site asking his pages to fade
I have a CentOS 5.8 server and am planning to install a later version
I have a website that I made and I am planning to redo it.
I have a C library that I'm planning to use in an iPhone application.
we have started research on Service Broker and planning to implement in application. But

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.