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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:16:02+00:00 2026-05-28T11:16:02+00:00

Please look 5 min at this simple bug : <textblock (…) Width=0 /> Working

  • 0

Please look 5 min at this simple bug :

<textblock (...) Width="0" />

Working great, the textBox appears to be 0px thin. Works with value like, 2, 3, 4…

Now that is NOT working :

<TextBlock (...) />
    <TextBlock.Width>
        <MultiBinding Converter="{StaticResource WidthConverter}">
             <MultiBinding.Bindings>
                   <Binding RelativeSource="{RelativeSource Self}" />
                   <Binding RelativeSource="{x:Static RelativeSource.Self}" Path="TemplatedParent.Parent.ActualWidth"  />
              </MultiBinding.Bindings>
         </MultiBinding>
    <TextBlock.Width>
</TextBlock>
Public Class WidthConverter
    Implements IMultiValueConverter

        Public Function Convert(ByVal values() As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IMultiValueConverter.Convert

        Return 0
    End function
end class

why can i set zero value to TextBox.Width in xaml and not in code behind ?

By using a converter, when returing 0, the TextBlock.Width is not set to 0 but to “auto”, i can read the text

  • 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-28T11:16:02+00:00Added an answer on May 28, 2026 at 11:16 am

    The property is of type double, you return an int, change it to return 0.0 and it should work.

    (The reason being that bindings set properties via reflection, and there is no implicit conversion in that, so if you return an int that is considered to be not a number and double.NaN is the value used to describe the Auto behavior)

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

Sidebar

Related Questions

Please look this example: select { width: 172px; height: 22px; padding: 2px 7px; border:
Please look at this image here is 3 tables , and out i want
I have a problem with internet explorer 6 and 7, please look this example
Look please below this codes throw me : FormatException was unhandled by user code
Please look at this code (and forgive the lack of knowledge). It outputs errors
please look at the simple php webpage code below how can modify my code
Please have a look at the following code: <HTML> <HEAD> <script src=//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js type=text/javascript></script> <SCRIPT
Please look at this code int i = 10; //line 1 int *p =
i would like someone with experience in JavaScript to please look through this script
I'm a complete newbie to JavaScript trying to understand simple things.... Please look at

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.