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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. WCF and WF
  4. HitTest

HitTest

Scheduled Pinned Locked Moved WCF and WF
help
9 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    Ahamed Azeem
    wrote on last edited by
    #1

    Dear Guys, I have used the below code for the hit test. It always showing no suitable method found to override error on "protected override void OnInitialized(EventArgs e) Code is below

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;

    namespace InputExamples2
    {
    public partial class MousePosition
    {
    public MousePosition()
    {
    this.InitializeComponent();

    		// Insert code required on object creation below this point.
    	}
    	
    	protected override void OnInitialized(EventArgs e)
    	{
    		base.OnInitialized(e);
    		DragEllipse.RenderTransform = ellipseTransform;
    		CompositionTarget.Rendering += this.CompositionTarget\_Rendering;
    	}
    	
    	private void CompositionTarget\_Rendering(object sender, EventArgs e)
    	{
    	Point mouse1 = Mouse.GetPosition(firstEllipse);
    	Point mouse2 = Mouse.GetPosition(secondEllipse);
    	Point mouse3 = Mouse.GetPosition(thirdEllipse);
    	Point mouse4 = Mouse.GetPosition(fourthEllipse);
    	firstCoordinates.Content = mouse1.ToString();
    	secondCoordinates.Content = mouse2.ToString();
    	thirdCoordinates.Content = mouse3.ToString();
    	fourthCoordinates.Content = mouse4.ToString();
    	Point position = Mouse.GetPosition(DragEllipse);
    	ellipseTransform.X += position.X - (DragEllipse.Width / 2);
    	ellipseTransform.Y += position.Y - (DragEllipse.Height / 2);
    	}
    	
    }
    

    }

    Please help me to resolve this error

    Ahamed Azeem software Programmer

    D I 2 Replies Last reply
    0
    • A Ahamed Azeem

      Dear Guys, I have used the below code for the hit test. It always showing no suitable method found to override error on "protected override void OnInitialized(EventArgs e) Code is below

      using System;
      using System.Collections.Generic;
      using System.Text;
      using System.Windows;
      using System.Windows.Controls;
      using System.Windows.Data;
      using System.Windows.Documents;
      using System.Windows.Input;
      using System.Windows.Media;
      using System.Windows.Media.Imaging;
      using System.Windows.Shapes;

      namespace InputExamples2
      {
      public partial class MousePosition
      {
      public MousePosition()
      {
      this.InitializeComponent();

      		// Insert code required on object creation below this point.
      	}
      	
      	protected override void OnInitialized(EventArgs e)
      	{
      		base.OnInitialized(e);
      		DragEllipse.RenderTransform = ellipseTransform;
      		CompositionTarget.Rendering += this.CompositionTarget\_Rendering;
      	}
      	
      	private void CompositionTarget\_Rendering(object sender, EventArgs e)
      	{
      	Point mouse1 = Mouse.GetPosition(firstEllipse);
      	Point mouse2 = Mouse.GetPosition(secondEllipse);
      	Point mouse3 = Mouse.GetPosition(thirdEllipse);
      	Point mouse4 = Mouse.GetPosition(fourthEllipse);
      	firstCoordinates.Content = mouse1.ToString();
      	secondCoordinates.Content = mouse2.ToString();
      	thirdCoordinates.Content = mouse3.ToString();
      	fourthCoordinates.Content = mouse4.ToString();
      	Point position = Mouse.GetPosition(DragEllipse);
      	ellipseTransform.X += position.X - (DragEllipse.Width / 2);
      	ellipseTransform.Y += position.Y - (DragEllipse.Height / 2);
      	}
      	
      }
      

      }

      Please help me to resolve this error

      Ahamed Azeem software Programmer

      D Offline
      D Offline
      Daniel Vaughan
      wrote on last edited by
      #2

      Hi Ahamed, Subscribe to the Initialized event instead:

      public YourControl()
      {
      Initialized += new EventHandler(YourControl_Initialized);
      }

      Cheers, Daniel

      Daniel Vaughan Latest News on Twitter Blog: DanielVaughan.Orpius.com Open Source Projects: Calcium SDK, Clog Organization: Outcoder 5 Days Consulting Available in March

      A 1 Reply Last reply
      0
      • D Daniel Vaughan

        Hi Ahamed, Subscribe to the Initialized event instead:

        public YourControl()
        {
        Initialized += new EventHandler(YourControl_Initialized);
        }

        Cheers, Daniel

        Daniel Vaughan Latest News on Twitter Blog: DanielVaughan.Orpius.com Open Source Projects: Calcium SDK, Clog Organization: Outcoder 5 Days Consulting Available in March

        A Offline
        A Offline
        Ahamed Azeem
        wrote on last edited by
        #3

        Thanks for your reply Daniel Could you please explain me little more

        Ahamed Azeem software Programmer

        D 1 Reply Last reply
        0
        • A Ahamed Azeem

          Dear Guys, I have used the below code for the hit test. It always showing no suitable method found to override error on "protected override void OnInitialized(EventArgs e) Code is below

          using System;
          using System.Collections.Generic;
          using System.Text;
          using System.Windows;
          using System.Windows.Controls;
          using System.Windows.Data;
          using System.Windows.Documents;
          using System.Windows.Input;
          using System.Windows.Media;
          using System.Windows.Media.Imaging;
          using System.Windows.Shapes;

          namespace InputExamples2
          {
          public partial class MousePosition
          {
          public MousePosition()
          {
          this.InitializeComponent();

          		// Insert code required on object creation below this point.
          	}
          	
          	protected override void OnInitialized(EventArgs e)
          	{
          		base.OnInitialized(e);
          		DragEllipse.RenderTransform = ellipseTransform;
          		CompositionTarget.Rendering += this.CompositionTarget\_Rendering;
          	}
          	
          	private void CompositionTarget\_Rendering(object sender, EventArgs e)
          	{
          	Point mouse1 = Mouse.GetPosition(firstEllipse);
          	Point mouse2 = Mouse.GetPosition(secondEllipse);
          	Point mouse3 = Mouse.GetPosition(thirdEllipse);
          	Point mouse4 = Mouse.GetPosition(fourthEllipse);
          	firstCoordinates.Content = mouse1.ToString();
          	secondCoordinates.Content = mouse2.ToString();
          	thirdCoordinates.Content = mouse3.ToString();
          	fourthCoordinates.Content = mouse4.ToString();
          	Point position = Mouse.GetPosition(DragEllipse);
          	ellipseTransform.X += position.X - (DragEllipse.Width / 2);
          	ellipseTransform.Y += position.Y - (DragEllipse.Height / 2);
          	}
          	
          }
          

          }

          Please help me to resolve this error

          Ahamed Azeem software Programmer

          I Offline
          I Offline
          Ian Shlasko
          wrote on last edited by
          #4

          Ahamed Azeem wrote:

          public partial class MousePosition

          Nothing to override, because you're not inheriting from anything. I'm surprised you're not getting a compiler error, telling you that the different partial class declarations aren't compatible.

          Proud to have finally moved to the A-Ark. Which one are you in?
          Author of Guardians of Xen (Sci-Fi/Fantasy novel)

          1 Reply Last reply
          0
          • A Ahamed Azeem

            Thanks for your reply Daniel Could you please explain me little more

            Ahamed Azeem software Programmer

            D Offline
            D Offline
            Daniel Vaughan
            wrote on last edited by
            #5

            Ahamed, What is the type of the associated xaml file?

            Daniel Vaughan Latest News on Twitter Blog: DanielVaughan.Orpius.com Open Source Projects: Calcium SDK, Clog Organization: Outcoder 5 Days Consulting Available in March

            A 1 Reply Last reply
            0
            • D Daniel Vaughan

              Ahamed, What is the type of the associated xaml file?

              Daniel Vaughan Latest News on Twitter Blog: DanielVaughan.Orpius.com Open Source Projects: Calcium SDK, Clog Organization: Outcoder 5 Days Consulting Available in March

              A Offline
              A Offline
              Ahamed Azeem
              wrote on last edited by
              #6

              xaml.cs

              Ahamed Azeem software Programmer

              D 1 Reply Last reply
              0
              • A Ahamed Azeem

                xaml.cs

                Ahamed Azeem software Programmer

                D Offline
                D Offline
                Daniel Vaughan
                wrote on last edited by
                #7

                That doesn't tell me what the type is. What are the first couple of lines in xaml.cs?

                Daniel Vaughan Latest News on Twitter Blog: DanielVaughan.Orpius.com Open Source Projects: Calcium SDK, Clog Organization: Outcoder 5 Days Consulting Available in March

                A 1 Reply Last reply
                0
                • D Daniel Vaughan

                  That doesn't tell me what the type is. What are the first couple of lines in xaml.cs?

                  Daniel Vaughan Latest News on Twitter Blog: DanielVaughan.Orpius.com Open Source Projects: Calcium SDK, Clog Organization: Outcoder 5 Days Consulting Available in March

                  A Offline
                  A Offline
                  Ahamed Azeem
                  wrote on last edited by
                  #8

                  <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" x:Class="AnimationExamples.Rotation" x:Name="Page" WindowTitle="Page" FlowDirection="LeftToRight" Width="640" Height="480" WindowWidth="640" WindowHeight="480" >

                  Ahamed Azeem software Programmer

                  D 1 Reply Last reply
                  0
                  • A Ahamed Azeem

                    <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" x:Class="AnimationExamples.Rotation" x:Name="Page" WindowTitle="Page" FlowDirection="LeftToRight" Width="640" Height="480" WindowWidth="640" WindowHeight="480" >

                    Ahamed Azeem software Programmer

                    D Offline
                    D Offline
                    Daniel Vaughan
                    wrote on last edited by
                    #9

                    Sorry for the delay Ahamed. I see that your Page x:Class is "AnimationExamples.Rotation". Change it to "InputExamples2.MousePosition" to match your class name. Cheers, Daniel

                    Daniel Vaughan Latest News on Twitter Blog: DanielVaughan.Orpius.com Open Source Projects: Calcium SDK, Clog Organization: Outcoder 5 Days Consulting Available in March

                    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