Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8530199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:12:18+00:00 2026-06-11T09:12:18+00:00

As I am new with XAML and WPF my question might be ambigious. Accept

  • 0

As I am new with XAML and WPF my question might be ambigious. Accept my appologies in advance.

To make it simple, I am working on a project in which I have some buttons and a custom pointer to select one of these buttons. I could get the program working without using grid rows and columns to organize my elements. However when I was maximizing the window it was a mess. So, I used grid rows and columns with persentage width and height and solved this problem. But now, the pointer gets stucked in one of the grids and does not move outside. I want to define my pointer somehow that it can move along the whole grid without getting binded to a row or column. Here is my XAML code:

<Window x:Class="testGallery.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local ="clr-namespace:Kinect.Toolbox;assembly=Kinect.Toolbox"
    Loaded="Window_Loaded"
    Title="MainWindow">

<Grid Margin="0,0,0,97">
    <Grid.RowDefinitions>
        <RowDefinition Height="68*" />
        <RowDefinition Height="101*" />
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="150*" />
        <ColumnDefinition Width="150*" />
    </Grid.ColumnDefinitions>

    <Button Click="Button_Click_1" Grid.Column="1" Grid.Row="1" Margin="10" >
        <StackPanel>
            <Image x:Name="myImage" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="5"/>
        </StackPanel>
    </Button>

    <Canvas x:Name="mouseCanvas" Margin="-24,263,24,-263"/>
</Grid>
</Window>

In the code above the Convas is my custom pointer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:12:20+00:00Added an answer on June 11, 2026 at 9:12 am

    Try

    <Canvas x:Name="mouseCanvas" Grid.ColumnSpan="2" Grid.RowSpan="2" Margin="-24,263,24,-263"/>
    

    That will allow your canvas to use all your available row and columns. Because you have two of each, setting the Spans to “2” means the whole grid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Being a new to WPF/XAML/MVVM, I've got a question. In my View, I have
I am new to WPF/XAML so please bear with the noob question. I have
I am NEW to WPF. I have the following XAML code: </Window> ... <Canvas>
Simple WPF question I have a text Box and an OK Button and I
i am new to WPF and i have one question(the first one actually, more
I am (very) new to WPF and I have got a question regarding that.
Simple WPF/XAML question. In XAML, how do I reference the Self/this object in a
I am new to WPF. I have created a WPF project, and add the
I'm relatively new to using WPF and the MVVM architecture. I have a question
I am quite new to WPF and this might be a trivial question. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.