【问题标题】:Set the Margin property in C++/CX in a Windows 8 XAML project在 Windows 8 XAML 项目的 C++/CX 中设置 Margin 属性
【发布时间】:2012-03-21 21:06:37
【问题描述】:

我正在尝试通过代码设置我的EllipseMargin。如何设置Marginp

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

【问题讨论】:

    标签: c++ xaml windows-8 windows-runtime c++-cx


    【解决方案1】:

    Thickness是值类型,不是引用类型,所以不是用ref new创建的。

    p->Margin = Windows::UI::Xaml::Thickness(10.0, 20.0, 30.0, 40.0);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-07-03
      • 1970-01-01
      • 2013-03-19
      • 1970-01-01
      • 2019-09-23
      • 2015-07-01
      • 2013-03-17
      相关资源
      最近更新 更多