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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:25:01+00:00 2026-05-28T15:25:01+00:00

I am making an application with WPF and I have a UserControl with a

  • 0

I am making an application with WPF and I have a UserControl with a Awesomium WebControl.

The moment I add a copy of this UserControl to my main window, I get an ArgumentException from WindowsBase.dll saying that “Width and Height must be positive”.

Here is that UserControl:

<UserControl x:Class="ForumPost.ForumPost"
         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" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" MinWidth="505" MinHeight="250" xmlns:my="http://schemas.awesomium.com/winfx">
<Grid Name="postGrid" Margin="5">
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition/>
    </Grid.RowDefinitions>

    <Grid Background="#3166A1">
        <Grid.RowDefinitions>
            <RowDefinition MinHeight="150" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="150" />
            <ColumnDefinition MinWidth="100" />
            <ColumnDefinition MinWidth="125" />
            <ColumnDefinition MinWidth="125" />
        </Grid.ColumnDefinitions>

        <Grid Height="150">
            <Grid.RowDefinitions>
                <RowDefinition Height="25" />
                <RowDefinition Height="125" />
            </Grid.RowDefinitions>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition MinWidth="20"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>

                <Image Margin="0 0 5 0" Name="specialUserFlag"/>

                <TextBlock TextAlignment="Center" FontWeight="Bold" FontSize="16" Foreground="White" Name="postUsername" Grid.Column="1"/>
            </Grid>

            <Image Grid.Row="1" MaxWidth="125" MaxHeight="125" Name="postAvatar" />
        </Grid>

        <TextBlock Grid.Column="2" TextAlignment="Center" FontWeight="Bold" FontSize="16" Foreground="White" VerticalAlignment="Center"  Name="postTimestamp" TextWrapping="Wrap" />

    </Grid>
    <my:WebControl Grid.Row="1" Name="webBrowser"/>
</Grid>    

And here is my main window, as @LukeWoodward requested:

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Class="Saxaphone.MainWindow"
    Title="MainWindow" Height="850" Width="1600"
    Icon="main.ico">

<Grid x:Name="MainGrid">
    <Grid.RowDefinitions>
        <RowDefinition />
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="305" />
        <ColumnDefinition MinWidth="1017" />
    </Grid.ColumnDefinitions>

    <TreeView x:Name="ForumView" ScrollViewer.HorizontalScrollBarVisibility="Diforumbled" Style="{DynamicResource ForumViewStyle}" SelectedItemChanged="ForumView_SelectedItemChanged" />

    <Grid x:Name="forumGrid" Grid.Column="1">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="512" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden" Grid.Column="0" Height="{Binding ActualHeight, ElementName=forumGrid}">
                <StackPanel x:Name="forumThreads"></StackPanel>
        </ScrollViewer>

        <ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" Grid.Column="1" Height="{Binding ActualHeight, ElementName=forumGrid}">
            <StackPanel x:Name="forumPosts"/>
        </ScrollViewer>
    </Grid>
</Grid>

  • 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-05-28T15:25:02+00:00Added an answer on May 28, 2026 at 3:25 pm

    I’ve now been able to reproduce the ArgumentException you’re getting. I suspect that this is a bug in Awesomium. I would recommend that you contact Awesomium Support at http://support.awesomium.com/.

    I found that the following XAML is sufficient to reproduce the ArgumentException. There was no need for any user-controls nor adding controls at runtime:

    <StackPanel>
        <as:WebControl xmlns:as="http://schemas.awesomium.com/winfx" />
    </StackPanel>
    

    I found that it was possible to work around this issue by setting an explicit Width and Height on the WebControl. It seems that a WebControl doesn’t like being inside a StackPanel unless it (the WebControl) has both Width and Height set.

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

Sidebar

Related Questions

In my application (WPF) i have this window: public partial class Window1 : Window
I am making a WPF-application.I have a datagrid with a column header that contains
I'm working on a UI for a WPF application. I have in my window
I have developed a WPF application in C# 4.0. This application is installing some
I have written an application (wpf - will Mono translate this for a Mac?)
In a WPF application the main window has a content control to which one
I have WPF 4 desktop-based application. In one of the windows of this application,
I'm making a WPF application that is comprised of Screens (Presenter + View). I
I am making an application with Java Swing and i have a problem. I
In terms of making a decision between WPF or Silverlight for an application does

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.