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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:50:19+00:00 2026-05-21T07:50:19+00:00

I have a created a resource dictionary as <ResourceDictionary x:Class=RPK.WindowsResources xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:vm=clr-namespace:RPK.ViewModel xmlns:vw=clr-namespace:RPK.View

  • 0

I have a created a resource dictionary as

<ResourceDictionary x:Class="RPK.WindowsResources"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vm="clr-namespace:RPK.ViewModel"
    xmlns:vw="clr-namespace:RPK.View"
    xmlns:Converter="clr-namespace:RPK.Common">

    <sys:String x:Key="Key_Combo_Big_Width">200</sys:String>

<Style x:Key="ComboBig">
        <Setter Property="Control.Width" Value="{DynamicResource ResourceKey=Key_Combo_Big_Width}">
        </Setter>
        <Setter Property="Control.Height" Value="25"></Setter>
        <Setter Property="Control.VerticalAlignment" Value="Center"></Setter>
    </Style>
</ResourceDictionary>

I have applied this as a merged dictionary in my app.xaml

In my window1.xaml, I have applied this style as

<ComboBox Name="Combo1" Style="{StaticResource ComboBig}"/>

When I run the code I get this error

'200' is not a valid value for property 'Width'

What is the correct way?

  • 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-21T07:50:20+00:00Added an answer on May 21, 2026 at 7:50 am

    The Width property is a double so if you’re going to assign it a specifically typed resource value you need to use a double resource.

        <sys:Double x:Key="Key_Combo_Big_Width">200</sys:Double>
    
        <Style x:Key="ComboBig">
            <Setter Property="Control.Width" Value="{DynamicResource Key_Combo_Big_Width}">
            </Setter>
            <Setter Property="Control.Height" Value="25"></Setter>
            <Setter Property="Control.VerticalAlignment" Value="Center"></Setter>
        </Style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ResourceDictionary that contains strings: <ResourceDictionary xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:sys=clr-namespace:System;assembly=mscorlib> <sys:String x:Key=Foo>Hello world</sys:String>
I have a class named Animations and a resource dictionary named animationResources.xaml on the
I have used a custom class to implement shared resource functionality in my WPF
I have a Control Template for Progress Bar in my Resource Dictionary. Complete code
I Have a ResourceDictionary Generic.xaml which consists of a set of other resource dictionaries,
I have created a resource DLL for an IE addon with Visual C++ in
I have created a TabItem in a ResourceDictionary and use it in my UserControl
Okay, I have the following create action #posts_controller, nested resource under discussions def create
I have created a QWidget with a bunch of QToolButtons in it and I
I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -

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.