我想在我自己的对象的 C# 中获取/设置我的形状数据属性或定义了一些形状数据的已创建对象。
Data=shape.Cells["User.Level"].ToString();
我试过这个,没有结果。还有这个:
Data=shape.Cells["Prop.Level"].FormulaU="1";
谁能提供正确的代码?
最后我用这种方式解决了。永远的孤独!
private void GetValueOfCustomShapeData(Shape shape, string LabelToSearch)
{
short iRow = (short)VisRowIndices.visRowFirst;
// While there are stil rows to look at.
while (shape.get_CellsSRCExists((short)VisSectionIndices.visSectionProp,iRow,(short)VisCellIndices.visCustPropsValue,(short)0) != 0)
{
// Get the label and value of the current property.
string label = shape.get_CellsSRC(
(short)VisSectionIndices.visSectionProp,
iRow,
(short)VisCellIndices.visCustPropsLabel
).get_ResultStr(VisUnitCodes.visNoCast);
string value = shape.get_CellsSRC(
(short)VisSectionIndices.visSectionProp,
iRow,
(short)VisCellIndices.visCustPropsValue
).get_ResultStr(VisUnitCodes.visNoCast);
string strProperties = shape.Name + " - " + label + " - " + value;
MessageBox.Show(strProperties);
// Move to the next row in the properties
section.iRow++;
}