Click here to Skip to main content
15,901,122 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Any recommendation for WPF Datagrid?? Pin
Michael Sync10-Aug-08 23:31
Michael Sync10-Aug-08 23:31 
AnswerRe: Any recommendation for WPF Datagrid?? Pin
Jacquers11-Aug-08 21:19
Jacquers11-Aug-08 21:19 
QuestionWindow Background Brush Change Pin
BlitzPackage8-Aug-08 10:07
BlitzPackage8-Aug-08 10:07 
AnswerRe: Window Background Brush Change Pin
Insincere Dave8-Aug-08 13:58
Insincere Dave8-Aug-08 13:58 
GeneralRe: Window Background Brush Change Pin
BlitzPackage8-Aug-08 15:41
BlitzPackage8-Aug-08 15:41 
GeneralRe: Window Background Brush Change Pin
BlitzPackage8-Aug-08 15:51
BlitzPackage8-Aug-08 15:51 
AnswerRe: Window Background Brush Change Pin
Jammer8-Aug-08 22:38
Jammer8-Aug-08 22:38 
QuestionWPF Control Advice Pin
Harvey Saayman7-Aug-08 20:59
Harvey Saayman7-Aug-08 20:59 
Hey guys.

I'm totally new to WPF and I'm trying to write a control with it. The control is a calender and will be used as a roster where the user will select a shift to use for a specific day and then when one cycle has been set up the user must be able to copy that cycle for the rest of the year for example.

Here is the XAML code i have so far... Sorry if its a bit long

<UserControl x:Class="WPF_Calender_Control.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="350 " Width="420">

<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="25*" Focusable="True" />
<RowDefinition Height="25*" Focusable="True" />
<RowDefinition Height="60*" Focusable="True" />
<RowDefinition Height="60*" Focusable="True" />
<RowDefinition Height="60*" Focusable="True" />
<RowDefinition Height="60*" Focusable="True" />
<RowDefinition Height="60*" Focusable="True" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60*" />
<ColumnDefinition Width="60*" />
<ColumnDefinition Width="60*" />
<ColumnDefinition Width="60*" />
<ColumnDefinition Width="60*" />
<ColumnDefinition Width="60*" />
<ColumnDefinition Width="60*" />
</Grid.ColumnDefinitions>

<Rectangle Fill="LightGreen" Grid.Column="0" Grid.Row="1"/>
<Rectangle Fill="LightGreen" Grid.Column="1" Grid.Row="1"/>
<Rectangle Fill="LightGreen" Grid.Column="2" Grid.Row="1"/>
<Rectangle Fill="LightGreen" Grid.Column="3" Grid.Row="1"/>
<Rectangle Fill="LightGreen" Grid.Column="4" Grid.Row="1"/>
<Rectangle Fill="LightGreen" Grid.Column="5" Grid.Row="1"/>
<Rectangle Fill="LightGreen" Grid.Column="6" Grid.Row="1"/>

<Border Grid.Column="0" Grid.Row="1" BorderBrush="Black" BorderThickness="1"/>
<Border Grid.Column="1" Grid.Row="1" BorderBrush="Black" BorderThickness="1"/>
<Border Grid.Column="2" Grid.Row="1" BorderBrush="Black" BorderThickness="1"/>
<Border Grid.Column="3" Grid.Row="1" BorderBrush="Black" BorderThickness="1"/>
<Border Grid.Column="4" Grid.Row="1" BorderBrush="Black" BorderThickness="1"/>
<Border Grid.Column="5" Grid.Row="1" BorderBrush="Black" BorderThickness="1"/>
<Border Grid.Column="6" Grid.Row="1" BorderBrush="Black" BorderThickness="1"/>

<Border Grid.Column="0" Grid.Row="2" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="1" Grid.Row="2" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="2" Grid.Row="2" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="3" Grid.Row="2" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="4" Grid.Row="2" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="5" Grid.Row="2" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="6" Grid.Row="2" BorderBrush="Black" BorderThickness="0.5"/>

<Border Grid.Column="0" Grid.Row="3" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="1" Grid.Row="3" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="2" Grid.Row="3" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="3" Grid.Row="3" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="4" Grid.Row="3" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="5" Grid.Row="3" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="6" Grid.Row="3" BorderBrush="Black" BorderThickness="0.5"/>

<Border Grid.Column="0" Grid.Row="4" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="1" Grid.Row="4" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="2" Grid.Row="4" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="3" Grid.Row="4" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="4" Grid.Row="4" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="5" Grid.Row="4" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="6" Grid.Row="4" BorderBrush="Black" BorderThickness="0.5"/>

<Border Grid.Column="0" Grid.Row="5" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="1" Grid.Row="5" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="2" Grid.Row="5" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="3" Grid.Row="5" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="4" Grid.Row="5" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="5" Grid.Row="5" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="6" Grid.Row="5" BorderBrush="Black" BorderThickness="0.5"/>

<Border Grid.Column="0" Grid.Row="6" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="1" Grid.Row="6" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="2" Grid.Row="6" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="3" Grid.Row="6" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="4" Grid.Row="6" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="5" Grid.Row="6" BorderBrush="Black" BorderThickness="0.5"/>
<Border Grid.Column="6" Grid.Row="6" BorderBrush="Black" BorderThickness="0.5"/>

<Canvas Name="Canvas00" Grid.Column="0" Grid.Row="2"/>
<Canvas Name="Canvas10" Grid.Column="1" Grid.Row="2"/>
<Canvas Name="Canvas20" Grid.Column="2" Grid.Row="2"/>
<Canvas Name="Canvas30" Grid.Column="3" Grid.Row="2"/>
<Canvas Name="Canvas40" Grid.Column="4" Grid.Row="2"/>
<Canvas Name="Canvas50" Grid.Column="5" Grid.Row="2"/>
<Canvas Name="Canvas60" Grid.Column="6" Grid.Row="2"/>

<Canvas Name="Canvas01" Grid.Column="0" Grid.Row="3"/>
<Canvas Name="Canvas11" Grid.Column="1" Grid.Row="3"/>
<Canvas Name="Canvas21" Grid.Column="2" Grid.Row="3"/>
<Canvas Name="Canvas31" Grid.Column="3" Grid.Row="3"/>
<Canvas Name="Canvas41" Grid.Column="4" Grid.Row="3"/>
<Canvas Name="Canvas51" Grid.Column="5" Grid.Row="3"/>
<Canvas Name="Canvas61" Grid.Column="6" Grid.Row="3"/>

<Canvas Name="Canvas02" Grid.Column="0" Grid.Row="4"/>
<Canvas Name="Canvas12" Grid.Column="1" Grid.Row="4"/>
<Canvas Name="Canvas22" Grid.Column="2" Grid.Row="4"/>
<Canvas Name="Canvas32" Grid.Column="3" Grid.Row="4"/>
<Canvas Name="Canvas42" Grid.Column="4" Grid.Row="4"/>
<Canvas Name="Canvas52" Grid.Column="5" Grid.Row="4"/>
<Canvas Name="Canvas62" Grid.Column="6" Grid.Row="4"/>

<Canvas Name="Canvas03" Grid.Column="0" Grid.Row="5"/>
<Canvas Name="Canvas13" Grid.Column="1" Grid.Row="5"/>
<Canvas Name="Canvas23" Grid.Column="2" Grid.Row="5"/>
<Canvas Name="Canvas33" Grid.Column="3" Grid.Row="5"/>
<Canvas Name="Canvas43" Grid.Column="4" Grid.Row="5"/>
<Canvas Name="Canvas53" Grid.Column="5" Grid.Row="5"/>
<Canvas Name="Canvas63" Grid.Column="6" Grid.Row="5"/>

<Canvas Name="Canvas04" Grid.Column="0" Grid.Row="6"/>
<Canvas Name="Canvas14" Grid.Column="1" Grid.Row="6"/>
<Canvas Name="Canvas24" Grid.Column="2" Grid.Row="6"/>
<Canvas Name="Canvas34" Grid.Column="3" Grid.Row="6"/>
<Canvas Name="Canvas44" Grid.Column="4" Grid.Row="6"/>
<Canvas Name="Canvas54" Grid.Column="5" Grid.Row="6"/>
<Canvas Name="Canvas64" Grid.Column="6" Grid.Row="6" />

<Label FontSize="10" HorizontalContentAlignment="Center" Name="label1" VerticalContentAlignment="Center" Grid.Column="0" Grid.Row="1">
Sunday
</Label>
<Label FontSize="10" HorizontalContentAlignment="Center" Name="label2" VerticalContentAlignment="Center" Grid.Column="1" Grid.Row="1">
Monday
</Label>
<Label FontSize="10" HorizontalContentAlignment="Center" Name="label3" VerticalContentAlignment="Center" Grid.Column="2" Grid.Row="1">
Tuesday
</Label>
<Label FontSize="10" HorizontalContentAlignment="Center" Name="label4" VerticalContentAlignment="Center" Grid.Column="3" Grid.Row="1">
Wensday
</Label>
<Label FontSize="10" HorizontalContentAlignment="Center" Name="label5" VerticalContentAlignment="Center" Grid.Column="4" Grid.Row="1">
Thursday
</Label>
<Label FontSize="10" HorizontalContentAlignment="Center" Name="label6" VerticalContentAlignment="Center" Grid.Column="5" Grid.Row="1">
Friday
</Label>
<Label FontSize="10" HorizontalContentAlignment="Center" Name="label7" VerticalContentAlignment="Center" Grid.Column="6" Grid.Row="1">
Saturday
</Label>
<Label FontSize="14" HorizontalContentAlignment="Center" Name="lblMonthYear" VerticalContentAlignment="Center" Grid.ColumnSpan="8" FontFamily="Comic Sans MS" FontWeight="Black">
July 2008
</Label>
<Button Name="btnSubtractYear" Grid.Column="0" Click="btnSubtractYear_Click">&lt;&lt; Year</Button>
<Button Name="btnSubtractMonth" Grid.Column="1" Click="btnSubtractMonth_Click">&lt;&lt; Month</Button>
<Button Name="btnAddMonth" Grid.Column ="5" Click="btnAddMonth_Click">Month &gt;&gt;</Button>
<Button Name="btnAddYear" Grid.Column="6" Click="btnAddYear_Click">Year &gt;&gt;</Button>
</Grid>
</UserControl>


As you can see ive got "Canvas" objects within the grid, but im not sure if thats the right control for what i need it to do.

at this point i need to be able to some painting on it from the code behind, depending on which month & year is selected the day numbers need to be drawn in the right blocks, but i cant seem to figure out how to do that... my brain is still thinking in GDI Roll eyes | :rolleyes:

any help would be appreciated

Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
AnswerRe: WPF Control Advice Pin
Jammer7-Aug-08 23:09
Jammer7-Aug-08 23:09 
AnswerRe: WPF Control Advice Pin
Gideon Engelberth8-Aug-08 3:19
Gideon Engelberth8-Aug-08 3:19 
QuestionGetting A DependencyProperty 'Original Value' Pin
Jammer7-Aug-08 12:53
Jammer7-Aug-08 12:53 
AnswerRe: Getting A DependencyProperty 'Original Value' Pin
Insincere Dave7-Aug-08 13:58
Insincere Dave7-Aug-08 13:58 
GeneralRe: Getting A DependencyProperty 'Original Value' Pin
Insincere Dave7-Aug-08 14:18
Insincere Dave7-Aug-08 14:18 
GeneralRe: Getting A DependencyProperty 'Original Value' Pin
Jammer7-Aug-08 20:56
Jammer7-Aug-08 20:56 
GeneralRe: Getting A DependencyProperty 'Original Value' Pin
Jammer7-Aug-08 20:54
Jammer7-Aug-08 20:54 
GeneralRe: Getting A DependencyProperty 'Original Value' Pin
Jammer7-Aug-08 22:54
Jammer7-Aug-08 22:54 
Questioncustom, main window look with wpf Pin
valajbeg7-Aug-08 0:57
valajbeg7-Aug-08 0:57 
AnswerRe: custom, main window look with wpf Pin
Thomas Stockwell7-Aug-08 1:47
professionalThomas Stockwell7-Aug-08 1:47 
GeneralRe: custom, main window look with wpf Pin
valajbeg7-Aug-08 1:53
valajbeg7-Aug-08 1:53 
GeneralRe: custom, main window look with wpf Pin
Pete O'Hanlon7-Aug-08 2:10
mvePete O'Hanlon7-Aug-08 2:10 
GeneralRe: custom, main window look with wpf Pin
valajbeg7-Aug-08 2:19
valajbeg7-Aug-08 2:19 
GeneralRe: custom, main window look with wpf Pin
Pete O'Hanlon7-Aug-08 3:02
mvePete O'Hanlon7-Aug-08 3:02 
GeneralRe: custom, main window look with wpf Pin
valajbeg7-Aug-08 3:10
valajbeg7-Aug-08 3:10 
GeneralRe: custom, main window look with wpf Pin
Thomas Stockwell7-Aug-08 3:27
professionalThomas Stockwell7-Aug-08 3:27 
GeneralRe: custom, main window look with wpf Pin
valajbeg7-Aug-08 3:29
valajbeg7-Aug-08 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.