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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:55:16+00:00 2026-06-03T04:55:16+00:00

I am new to the WPF development. I am developing a wpf application using

  • 0

I am new to the WPF development.

I am developing a wpf application using MVVM pattern. I had a ‘ComboBox’ and a ‘TextBlock’ controls. On getting focus over ComboBox, the Textblock should display the tool tip of the Combobox. Combobox is binded to view model.

<ComboBox Name="cmbSystemVoltage" 
          ToolTip="RMS value of phase-phase voltage in kV" 
          ItemsSource="{Binding Path=SystemVoltageStore}"
          SelectedItem="{Binding Path=SelectedSystemVoltage}" 
          DisplayMemberPath="SystemVoltageLevel"/>

How can I achieve this. Sample code to do so will be much helpful.

Thanks,
Sudhi

  • 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-03T04:55:18+00:00Added an answer on June 3, 2026 at 4:55 am

    Use a DataTrigger and bind per ElementName:

    <StackPanel>
        <TextBlock>
            <TextBlock.Style>
                <Style TargetType="{x:Type TextBlock}">                   
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=cmbSystemVoltage, Path=IsKeyboardFocusWithin}"
                                     Value="True">
                            <Setter Property="Text"
                                    Value="{Binding ElementName=cmbSystemVoltage, Path=ToolTip}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
        </TextBlock>
        <ComboBox Name="cmbSystemVoltage" ToolTip="RMS value of phase-phase voltage in kV" />
    </StackPanel>
    

    EDIT

    If you want to show tooltip of multiple controls in a TextBlock I would rather subscribe to PreviewGotKeyboardFocus Event:

    <Window PreviewGotKeyboardFocus="Window_PreviewGotKeyboardFocus">
        <StackPanel>
            <TextBlock x:Name="toolTipIndicator" />
            <ComboBox ToolTip="Sample text" />
            <TextBox ToolTip="Other sample text" />
        </StackPanel>
    </Window>
    

    .

    void Window_PreviewGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
    {
        FrameworkElement element = e.NewFocus as FrameworkElement;
    
        if (element != null && element.ToolTip != null)
        {
            this.toolTipIndicator.Text = element.ToolTip.ToString();
        }
        else
        {
            this.toolTipIndicator.Text = string.Empty;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to WPF development with C#, and I'm trying to develop an application
I recently built a new application using WPF, so that I can learn the
I am in the middle of development of a WPF application that is using
I am new to opengl and using C#, opentk for development. My Application is
I'm new to MVVM. Currently I'm developing a WPF project in C# that will
I'm developing a system using WPF 4. I pretend to use MVC in development.
I'm new to WPF development. Is anyone aware of a site or resource that
While designing a new WPF application I noticed exceptions not being thrown during data
I am new to WPF. I have Created some user Controls with some basic
I am about to create a new developer PC image for developing WPF applications

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.