Questions tagged [actualwidth]

ActualWidth is set by the rendering system, and may be different depending on the widths of other elements and overall size constraints. As a result, it can not be changed.

91 questions
1
vote
3 answers

Silverlight: when is ActualWidth not 0?

If I attach a callback to the loaded event of my main user control and check the ActualWidth of a grid column, that value is still 0. I find it strange, given the fact that the documentation states: "The Loaded event is raised before the final…
Randy Voet
  • 3,670
  • 4
  • 29
  • 36
1
vote
1 answer

Listbox width changes regardless of size of list items

Please see Update at bottom of post I'm writing a WPF app using .Net 4.5 I have a ListBox displaying movie info, the xaml is shown below.
Steve
  • 695
  • 10
  • 17
1
vote
1 answer

WPF dependecy property changed ActualWidth == 0

How do I force a Window to measure its controls in the constructor so the values of ActualWidth and ActualHeight aren't zero? Here is the sample demonstrating my problem (I tried to call Measure and Arrange functions, but maybe in a wrong…
1
vote
1 answer

Why is ActualWidth/ActualHeight don't changed after performing RenderTransform?

I have the following code to resize an image control private void ApplyScale() { ((CompositeTransform)img.RenderTransform).ScaleX = TotalImageScale; ((CompositeTransform)img.RenderTransform).ScaleY = TotalImageScale; …
PutraKg
  • 2,226
  • 3
  • 31
  • 60
1
vote
2 answers

Binding to ListBoxItem's ActualWidth

I have a ListBox, which is basically a canvas. The items shall be displayed as Rectangles. The position of the rectangles are bound to the items' data via the ListBoxItem's Canvas.Left and Canvas.Right property. This is the ListBox' Template, which…
Nico Schertler
  • 32,049
  • 4
  • 39
  • 70
1
vote
0 answers

Why is the viewbox's actualwidth growing much faster than it actually is?

A common issue with some controls in ViewBoxes is that they don't stretch to fill the Viewbox, so I tried to fix that with this code: Public Sub WindowResized() Handles Me.SizeChanged ComboBox_transfer_from.Width =…
cost
  • 4,420
  • 8
  • 48
  • 80
1
vote
2 answers

Changing Context Menu's width results in poor rendering

All I wanted to do is have a ContextMenu on a Button with the width bounded to the Button's width. Apparently that's too much. If you open the ContextMenu and then decrease the size of the Button and open it again everything's OK (the Width gets…
SHD_lotion
1
vote
2 answers

Unable to retrieve the ActualWidth / ActualHeight of ContentPresenter

In my application, we have a view model object from which we're retrieving its attached FrameworkElement using our custom function GetVisualChildWithDataContext (see below). What's happening is that this function returns a ContentPresenter object…
SuperOli
  • 1,784
  • 1
  • 11
  • 23
1
vote
2 answers

WPF Converter strange behavior

I am binding the Width of a TextBox to the ActualWidth of its containing Grid, as follows:
Bill
  • 1,407
  • 1
  • 15
  • 22
0
votes
1 answer

How to refer MaxWidth="??" of TextBlock to Owner ActualWidth?

How to refer MaxWidth="??" of TextBlock to stpMessage ActualWidth?
NoWar
  • 36,338
  • 80
  • 323
  • 498
0
votes
1 answer

WriteableBitmap adding black padding to right

I'm trying to make an Image out of one of my Canvas (myPrintingCanvas). But the Width of the image is getting atleast twice wider than the Canvas, and the extra space that is created is back. If I try on another Canavas (LayoutRoot), it works as…
Jimmy Mattsson
  • 2,085
  • 5
  • 19
  • 34
0
votes
0 answers

Why ActualWidth is not same as Width after resizing the Grid in WPF?

I have a ItemControl and there Width and ActualWidth rendering are not coming same while the resizing of panel is happening? It's very frustrating it is breaking whole UI. Tried n number of solution but coudn't found anything. Attaching screenshot…
0
votes
0 answers

Continuous (Edge-to-Edge) Rectangles in WPF overlaps each other

I am using WPF component in my project in which there is a feature of creating rectangles with the input given as a list containing for aligning rectangle over a canvas. I have given 0.5 stroke thickness to the rectangle but not any margin or…
0
votes
0 answers

Get the ActualWidth of a user control

I want to populate a Vertical StackPanel with objects of another UserControl. All UserControls should be scaled by the widest one. The widest control should use the full available width. ParentControl
Findas
  • 69
  • 3
0
votes
1 answer

wpf - RelativeSource ActualWidth binding error when added usercontrol is not in display area of ListView

I could not find the solution to this problem in internet. Can somebody please suggest me to correct this issue. Your help is much appreciated! With reference to the following msdn forum: …