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 8002149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:16:33+00:00 2026-06-04T16:16:33+00:00

I made a WPF Application, with a window a Grid and a button. In

  • 0

I made a WPF Application, with a window a Grid and a button. In the window SizeChanged event I scaleTransform my Grid to maximize it’s size but keeping the aspect ratio.

When ever I move the mouse over the button, the hottrack occurs as you would expect, but the mouse stalls for less than half a second, not a huge problem but it seems something isn’t right.

EDIT I suppose I never actually asked a question. What I want to know is. is this normal behavior, or is there something wrong with how I am doing this.

    //Store the initial size of the Grid
    double GridStartWidth;
    double GridStartHeight;

    public MainWindow()
    {
        InitializeComponent();
        //Get the values for the initial size of Grid
        GridStartWidth = MainGrid.Width;
        GridStartHeight = MainGrid.Height;
    }


    private void myMainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
    {
        double min = Math.Min(this.Height / GridStartHeight, this.Width / GridStartWidth);
        Transform tr = new ScaleTransform(min, min, .5, .5);
        MainGrid.LayoutTransform = tr;
    }

    private void button1_Click(object sender, RoutedEventArgs e)
    {
        Application.Current.Shutdown();
    }

Not sure if you need the Xaml but here it is

<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" 
Name="myMainWindow"
Width="1280" Height="1024" SizeChanged="myMainWindow_SizeChanged" AllowsTransparency="True" Background="#4FFFFFFF" WindowStyle="None" WindowState="Maximized">
<Grid Name="MainGrid"  Background="#FF8DC78D" Width="800" Height="600">

    <Button Content="Exit" Height="23" HorizontalAlignment="Left" Margin="13,12,0,0" Name="ExitButton" VerticalAlignment="Top" Width="75" Click="button1_Click" />
</Grid>

EDIT #2 I just tried to duplicate this issue starting from scratch, and testing it step by step as I added features. The problem occurs when I set the Window State as Maximized.

EDIT #3 Another Test I removed the Allow Transparency property, and set the background to a solid color, and it works fine. So the Problem has to do with Maximized window with a transparent background. Does this make sense?

  • 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-04T16:16:34+00:00Added an answer on June 4, 2026 at 4:16 pm

    Updating the mouse pointer on the screen in Windows has very high priority and mouse jitter or stutter is a result of driver problems or serious performance problems.

    WPF is available on Windows XP but hardware acceleration is not always available leading to performance problems. In particular there is a problem that affects transparent windows (which you use).

    Dwayne Need from Microsoft has a blog post about Transparent Windows in WPF:

    DirectX does provide the IDirect3DSurface9::GetDC method, which can return a DC that references the DirectX surface. Unfortunately there was a restriction in DX9c that would fail this method if it were called on a surface that contained an alpha channel. Of course, the entire point of our layered window API is to enable per-pixel transparency. This restriction was lifted for Vista, but our initial release forced WPF to use its software rendering fallback with rendering to a layered window on XP. We were able to lift this restriction for XP too, which we released as a hot fix (KB 937106). This hot fix was also included in XP SP3, so go get it! Now, on XP, we can render via DirectX and pass the results of IDirect3DSurface9::GetDC directly to UpdateLayeredWindow. On good video drivers, the resulting copy will remain entirely on the video card, leading to excellent performance. Some video drivers, however, may choose to perform this copy through system memory. The performance on such systems will not be nearly as good, but should still be reasonable for many scenarios.

    Your experience may be a result of not having the hot fix on your computer (but it is included in SP3), or a result of WPF having to switch to software rendering for your particular application.

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

Sidebar

Related Questions

i got this WPF application, and here i made a Splashscreen (wfp window) with
I have a WPF application that is made up of a window containing a
I a WPF application I have the following event-handler of a button-click in a
I have a WPF application written in C#. I have made a button. I
Recently I made the WPF application and want to publish it for many users
I have a WPF application which has a main window composed from several custom
i have a problem guys i made a wpf applications its running well but
I've made a setup project for my wpf application and set an icon for
I made a simple WPF application with DataGrid wchich is binded to the List
I have a WPF application with the main Window class called MainWindow. Since I

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.