WPF Web Based

WPF Examples

WPF

WPF Projects

WPF Project

adplus-dvertising
Formatting and Style of Listview in WPF WEB BASED
Previous Home Next

The following code sets background and foreground color of a ListViewItem.

<ListViewItem Background="LightCoral" Foreground="Red" Content="Coffie">
</ListViewItem>

Example:

<Page x:Class="WpfBrowserApplication5.Page4"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page4" Loaded="Page_Loaded">
<Grid Background="Beige">
<ListView Margin="8,47,0,80" Name="ListView1" 
	HorizontalAlignment="Left" Width="127">
<ListViewItem Content="C" Background="LightPink" 
		Foreground="Blue"    ></ListViewItem>
<ListViewItem Content="C++" Background="Violet" 
		Foreground="Blue"  ></ListViewItem>
<ListViewItem Content="Java" Background="Silver"
			Foreground="Blue"  ></ListViewItem>
<ListViewItem Content=".Net" Background="CadetBlue"
				Foreground="Blue"  ></ListViewItem>
<ListViewItem Content="Oracle"></ListViewItem>
<ListViewItem Content="SilverLight" Background="MediumSpringGreen" 
				Foreground="Blue"  >
</ListViewItem>
<ListViewItem Content="SharePoint" Background="DarkOrange"
			Foreground="Blue"  >
</ListViewItem>
<ListViewItem Content="WPF" Background="Bisque" 
			Foreground="Blue"  ></ListViewItem>
ListViewItem Content="WCF" Background="Gold" Foreground="Blue" >
</ListViewItem>
</ListView>
<TextBox Height="23" HorizontalAlignment="Left" Margin="8,14,0,0"
Name="textBox1" VerticalAlignment="Top" Width="127" />
<Button Height="23" Margin="140,14,0,0" Name="button1" 
			VerticalAlignment="Top"
HorizontalAlignment="Left" Width="76" Click="button1_Click">
Add Item
</Button>
<Button Height="23" Margin="140,47,0,0" Name="button2"
		VerticalAlignment="Top" Click="button2_Click" 
		HorizontalAlignment="Left" Width="76">Delete Item</Button>
</Grid>
</Page>
Output:
Previous Home Next
WPF Examples

WPF

WPF

WPF

WPF

WPF

WPF

WPF

WPF