문제

I am trying to set the Margin of my Ellipse through code. How can I set the Margin of p?

auto p = ref new Windows::UI::Xaml::Shapes::Ellipse();
p->Height=100.0;
p->Width=100.0;
//p->Margin="36,19,0,0";
auto t = ref new Windows::UI::Xaml::Thickness(10.0,20.0,30.0,40.0);
도움이 되었습니까?

해결책

Thickness is a value type, not a reference type, so it is not created with ref new.

p->Margin = Windows::UI::Xaml::Thickness(10.0, 20.0, 30.0, 40.0);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top