The usefulness of C # for the Data1, Data2, and Data3 of the shape of Visio two development

Source: Internet
Author: User

We know that Visio's Shape objects have 3 special properties, namely Data1, Data2, Data3, which we rarely use because we might be able to pass ShapeSheet's customed if we need attributes. Properties to define the information we need, the value of various attributes can be obtained, then Data1, Data2, Data3 for us, it is not very useful, but in some cases, we use it to do some operation is very convenient.

First we introduce what these attributes are, Data1, DATA2, Data3 are built-in properties of shape, do not need additional definitions, and it is said to be able to place 64K strings (not so large), and generally we are enough to place the content.

The word goes to the chase, we will use these attributes in any case, we think, we are in the drawing, there is always a picture frame to list those devices have a few equipment list, or a scale to explain what, these occasions can use them.

Because these lines, they may have been randomly drawn up, some of the equipment in the description and related information are generally based on the changes in the drawings, so each time you save, you may want to redraw, but when drawing, in order to distinguish from other device entities, we use these attributes to record the relevant information.

If we erase what we've already painted, we can do the following

 Erase the original statistics first
            if (Visioutility.hasshapeinwindow (Visapp.activewindow))
            {
                VisApp.ActiveWindow.SelectAll ();
                foreach (Visio.Shape shape in visApp.ActiveWindow.Selection)
                {
                    if shape. Data1 = = "Tongji")
                    {
                        shape. Delete ();
                    }
                }
                VisApp.ActiveWindow.DeselectAll ();
            }

If we need to add that information, first draw a shape from the coordinates

Visio.Shape Shape = Visioutility.drawrectangeonpage (Visapp, LEFTTOPX, Lefttopy-j * cellheight, 
                        LeftTopX + LeftCell Width, Lefttopy-(j + 1) * cellheight);

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.