Shape shape = shapes.AddShape();得到的对象,如何设置它的背景色??VC实现

解决方案 »

  1.   

    shape有许多类型,图片、自选图形....
    像图片根本就没有背景色这些东东,,LZ最终想控制什么?
      

  2.   

    我添加了一个Shape的文本框,想设置文本框的背景色。
      

  3.   

    如果是自选图形它有个填充颜色的概念。下面是VBA的代码:
        Selection.ShapeRange.Fill.Visible = msoTrue
        Selection.ShapeRange.Fill.Solid
        Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0)
        Selection.ShapeRange.Fill.Transparency = 0#
    LZ把它修改成VC语法就可以了。
      

  4.   

    spShape->Fill->put_Visible(MsoTriState::msoTrue);
    //其他类似,,,
      

  5.   


                    FillFormat fill_format;
    ColorFormat color_format;
    fill_format = shape.GetFill();
    color_format.SetRgb( RGB(255,255,255) );
    fill_format.SetVisible(true);
    fill_format.Solid();
    fill_format.SetBackColor(color_format);
    fill_format.SetTransparency(0);我这样写了,似乎还是不行啊。
    直接出错,在SetVisible