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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:34:51+00:00 2026-05-29T19:34:51+00:00

I need to have selection changed event inside a listbox itemtemplate. My listbox consists

  • 0

I need to have selection changed event inside a listbox itemtemplate. My listbox consists of three textblocks and an image. I want to get the third text block text only and when I select the third textblock the text in the text block will appear as a popup.

I used the visual tree to search for a textblock but it take the value of first text block instead of third textblock. What can i do to get the value of 2nd and 3rd textblocks. And I need to trigger a popup only when I click the textblock in the listbox not the whole listbox item.

<ListBox Name="listBox1" Width="Auto" SelectionChanged="Listbox1_SelectionChanged"> 
    <ListBox.ItemTemplate>
        <DataTemplate>
            <StackPanel>
                <Image Height="165" HorizontalAlignment="Left" Margin="10,40,-400,0"  VerticalAlignment="Top" Width="175" Source="{Binding thumb}"/>
                <TextBlock Name="pagetext"  TextWrapping="Wrap"  VerticalAlignment="Top" HorizontalAlignment="Left" Margin="195,-135,-200,0" Text="{Binding page}" Foreground="#FF170101" />
                <TextBlock Name="titletext" Width="1000" TextWrapping="NoWrap"  VerticalAlignment="Top" HorizontalAlignment="Left" Margin="195,-167,-200,0" Text="{Binding title}" Foreground="#FF170101" />
                <TextBlock Name="text" Width="1000" TextWrapping="NoWrap"  VerticalAlignment="Top" HorizontalAlignment="Left" Margin="195,-167,-200,0" Text="{Binding title}" Foreground="#FF170101" />
            </StackPanel>
        </DataTemplate>
    </ListBox.ItemTemplate>   
</ListBox>  
  • 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-29T19:35:00+00:00Added an answer on May 29, 2026 at 7:35 pm

    use TextBlock_MouseLeftButtonUp or TextBlock_Tap(this is rise when click on textblock)

    In this,

        private void TextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            TextBlock t = (TextBlock)sender;
            string s= t.Text;
        }
    

    the above string s disply where you want.

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

Sidebar

Related Questions

I have a QTableView that I need to get the selectionChanged event from. I
I need to have an event fired whenever Enter is pressed inside of the
I have a table of values and need to get the value of a
I have jQuery that uses the change event from a selection box to update
I want to have some code run when i change the selection of a
I have a web based (perl/MySQL) CRM system, and I need a section for
We have need for a rating system in a project we are working on,
I have need to select a number of 'master' rows from a table, also
I have the following need I have a logging table which logs som leads
I have need to produce LINE, BAR, and PIE charts in Rails. I have

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.