this is what I have in my xaml code so far
[code]
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
// I tried somthing different here with the green light*********************************************************************
[/code]
now here's my C# code
[code]
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace stopLightDemo
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void btnGreen_Click(object sender, RoutedEventArgs e)
{
Image myImage = new Image();
myImage.Width = 227;
BitmapImage myBitmapImage = new BitmapImage();
myBitmapImage.BeginInit();
myBitmapImage.UriSource = new Uri(@"G:\Users\Jason\Documents\C# Projects\WPF\stopLightDemo\stopLightDemo\images\Go.png");
myBitmapImage.DecodePixelWidth = 227;
myBitmapImage.EndInit();
myImage.Source = myBitmapImage;
}
private void btnYellow_Click(object sender, RoutedEventArgs e)
{
}
private void btnRed_Click(object sender, RoutedEventArgs e)
{
}
private void btnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}
[/code]
what could I be possibly be doing wrong????
Thank You!!!
email: [email protected]
Replies
Know the answer? Post it — somebody with the same question will find it here.