How to get or compute actual width of ListBox without Vertical Scrollbar if visible
-
I wonder how to get or compute actual width of ListBox without Vertical Scrollbar if visible. What I want to do is changing width of each items inside ListBox without being covered by Vertical Scrollbar. Width="{Binding ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBox}}} At least, above binding tell me the actual width of ListBox, but this one does not handle width of vertical scrollbar. Is there any good way to solve this?
-
Answer:
Try binding to the ViewportWidth property of the containing ScrollViewer instead. Like this: Width="{Binding Path=ViewportWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ScrollViewer}}"
Aki24x at Stack Overflow Visit the source
Related Q & A:
- How To Get Microsoft Points For Free Without Surveys?Best solution by Yahoo! Answers
- How To Get Free Microsoft Points Without Doing Surveys?Best solution by Yahoo! Answers
- How to get actual return type of a generic static method in Java?Best solution by stackoverflow.com
- How to get BitmapFont width in LibGDX?Best solution by Stack Overflow
- How do you get the page to turn from hoazonal to vertical on the dell 1704FPTt 17" TFT LCD Flat Panel Monitor?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.