![](/img/trans.png)
[英]Binding errors While Binding null values to Width and Height of the wpf control
[英]WPF set width of control by binding in centimeter
我想通過綁定和厘米來設置我的控件的寬度。 (這是我的打印輸出的大小所以我發現使用厘米很容易)
所以我想做這樣的事情:
<FlowDocument x:Name="flowdocument" PageWidth="{Binding Barcode.Width}" PageHeight="{Binding BarcodeSjabloon.Height}">
但我想把它設置為厘米,如下所示:
<FlowDocument x:Name="flowdocument" PageWidth="20cm" PageHeight="30cm">
知道怎么做到這一點?
您可以定義一個了解語法的轉換器,並使用當前的DPI設置轉換為適當的像素數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.