简体   繁体   English

WPF网格不保持其宽度和高度

[英]WPF Grid not keeping its Width and Height

I have a Canvas inside of a Grid in a WPF app. 我在WPF应用程序中的Grid中有一个Canvas。 I want to draw a skeleton in Canvas from Kinect data. 我想从Kinect数据中绘制Canvas中的骨架。 But the Canvas has a tiny width, probably 1px. 但Canvas有一个很小的宽度,可能是1px。 The Grid makes it shrink, not keeping its set Width and Height. Grid使其缩小,而不是保持其设置的Width和Height。 How to make Grid keep its declared size? 如何使Grid保持其声明的大小?

确保网格和画布都具有HorizontalAlignment="Stretch"VerticalAlignment="Stretch"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM