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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:46:48+00:00 2026-06-18T01:46:48+00:00

I have a WPF application I’m working on and the form is being built

  • 0

I have a WPF application I’m working on and the form is being built using images…I’ve run into a problem though with resizing the form.

The issue is that for the individual row backgrounds at the top I need to keep the height at a fixed size, while allowing the width to resize to fit the window…However any time I try to put a height or max height value or anything like that the image control stops fitting the window entirely.

Now I may be going about this entirely the wrong way as I’m newish to WPF so if anyone has a better way of doing this please let me know.

This is the XAML I’m using so far, the issue is with the TitleBarImage:

<Window x:Class="App.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Application" Height="{Binding SystemParameters.PrimaryScreenHeight}" Width="{Binding SystemParameters.PrimaryScreenWidth}" AllowsTransparency="True" WindowStyle="None" MinWidth="1024" MinHeight="749" WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Image x:Name="TitleBarImage" Grid.Row="0" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Top" Source="skin/title-bar.png" MouseLeftButtonDown="TitleBarImage_MouseLeftButtonDown" MouseDown="TitleBarImage_MouseDoubleClick"/>
        <Image HorizontalAlignment="Right" Grid.Row="0" Grid.Column="2" Height="23" Margin="0,17,74,0" VerticalAlignment="Top" Width="34" Source="skin/min-button.png" MouseLeftButtonUp="MinImage_MouseLeftButtonUp"/>
        <Image HorizontalAlignment="Right" Grid.Row="0" Grid.Column="2" Height="23" Margin="0,17,40,0" VerticalAlignment="Top" Width="34" Source="skin/max-button.png" MouseLeftButtonUp="MaxImage_MouseLeftButtonUp"/>
        <Image HorizontalAlignment="Right" Grid.Row="0" Grid.Column="2" Height="23" Margin="0,17,7,0" VerticalAlignment="Top" Width="33" Source="skin/close-button.png" MouseLeftButtonUp="Image_MouseLeftButtonUp_1" RenderTransformOrigin="21.121,-4.522"/>
    </Grid>
</Window>
  • 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-18T01:46:49+00:00Added an answer on June 18, 2026 at 1:46 am

    You need to set the Stretch property on your image to Fill, otherwise it will keep its original aspect ratio and won’t fit the area properly.

    <Image ... Stretch="Fill"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have WPF Application where I have One main form and other user controls
I have a wpf application using Caliburn.Micro. I need to bind a ListBox to
I have a wpf application using caliburn.micro. It has a datagrid and a combobox.
I have a WPF application that includes buttons with PNG images. The actual images
I have WPF application that has a login form. I would like to make
I have wpf application in which I am using ENTER key as TAB &
I have simple WPF application where I using threads. E.g. In new thread I
We have a wpf application in .Net Framework 4 and using SQL Server Express
I have a WPF application where I'm using dependency properties in codebehind which I
I have WPF application project and I'm using EF. I want something like this.

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.