i am using vsto, to work with excel-2007…
let’s consider i have a matrix as follows
A B C
1 10 11 12
2 10 12 11
3 11 10 12
i will always read some random matrix filled with random numbers… ex above,
and the other condition is that they will also be colored randomly according to the
same numbers, for ex. in the above case cells which contain 10 will be colored red,
those with 11 will be colored green, and so on…
now i have to put some kind of panel on a worksheet which will show info of this kind
rectangle with RED color - 10
rectangle with GREEN color - 11
rectangle with BLUE color - 12
i tried to do it with charts, but unfortunately did not succeed,…
i cannot put those info on a range of cells, that’s not a solution i am
looking for,… i have to put it on
some kind of panel, so that user will be able to drag the panel wherever they want,
..
i have no idea how to do it, please can you suggest me a way how create smth kind of
panel and to put that info there… Thanks!
sorry for not mentioning this, iwant to be able to put rectangles inside the
panel, so that whenever i move the panel all the components of the panel should move
together… also i do not want user to be able to modify the contents of the panel,
they should only be able to move the panel only…
For text only, a textbox would probably do the trick.
If you definitely need rectangles, you could construct several drawing objects: filled-in Rectangles for the coloured rectangles, textboxes for the descriptions and a Rectangle with a white background to act as a frame for the legend. Once drawn, you could Group them which would turn them into a single object from the users’ POV.
Here’s a edited example from MSDN I’ve converted to C# and tested:
This creates three triangles that are linked together – the user would drag them around as if a single object.