Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Getting an Item Inside Lisboxitem in c#

Getting an Item Inside Lisboxitem in c#

Scheduled Pinned Locked Moved WPF
csharpcss
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michael cohen
    wrote on last edited by
    #1

    Hey guys i would like to get the selected item inside the listboxitem and change his look , here is the code of my listbox... i would like to change "FutureExtension" Background or something...

    <ListBox.ItemTemplate>
    <DataTemplate>
    <StackPanel>
    <StackPanel Orientation="Horizontal" >
    <my2:FutureExtension x:Name="T2" Loaded="T2_Loaded" Grid.Row="3" Margin="1,1,10,10"></my2:FutureExtension>
    <my2:FutureExtension x:Name="T3" Loaded="T3_Loaded" Grid.Row="3" Margin="1,1,10,10"></my2:FutureExtension>
    <my2:FutureExtension x:Name="T4" Loaded="T4_Loaded" Grid.Row="3" Margin="1,1,10,10"></my2:FutureExtension>
    </StackPanel>
    <!--<Border Height="20" Background="Black" BorderBrush="Orange" BorderThickness="3">
    </Border>-->
    </StackPanel>

                    </DataTemplate>
               </ListBox.ItemTemplate>
    
    P 1 Reply Last reply
    0
    • M michael cohen

      Hey guys i would like to get the selected item inside the listboxitem and change his look , here is the code of my listbox... i would like to change "FutureExtension" Background or something...

      <ListBox.ItemTemplate>
      <DataTemplate>
      <StackPanel>
      <StackPanel Orientation="Horizontal" >
      <my2:FutureExtension x:Name="T2" Loaded="T2_Loaded" Grid.Row="3" Margin="1,1,10,10"></my2:FutureExtension>
      <my2:FutureExtension x:Name="T3" Loaded="T3_Loaded" Grid.Row="3" Margin="1,1,10,10"></my2:FutureExtension>
      <my2:FutureExtension x:Name="T4" Loaded="T4_Loaded" Grid.Row="3" Margin="1,1,10,10"></my2:FutureExtension>
      </StackPanel>
      <!--<Border Height="20" Background="Black" BorderBrush="Orange" BorderThickness="3">
      </Border>-->
      </StackPanel>

                      </DataTemplate>
                 </ListBox.ItemTemplate>
      
      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      The wonderful Bea Costa provides a fantastic sample that you can use as the basis of this. Find out about it here[^].

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      My blog | My articles | MoXAML PowerToys

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups