private Point startpoint; private Rectangle rect; private void canvas1_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { startpoint = Mouse.GetPosition(canvas1); // the rectengle that i creat and i what to pass him to the canvas1_MouseMove Event function Rectangle rect = new Rectangle(); rect.Stroke = Brushes.Black; rect.StrokeThickness = 1; canvas1.Children.Add(rect); } private void canvas1_MouseMove(object sender, MouseEventArgs e) { //to here i want to pass the rectangle // when i debug the code the rect value is null! // so i cant control his Properties rect.Width = 5;// her i got excsption //"Object reference not set to an instance of an object." rect.Height = 6; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)