Mehul Rastogi
Mehul Rastogi

Reputation: 13

Set the Margin property in C++/CX in a Windows 8 XAML project

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);

Upvotes: 1

Views: 1875

Answers (1)

James McNellis
James McNellis

Reputation: 355207

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);

Upvotes: 5

Related Questions