Write color index to Visio shapesheet via VB? 
Author Message
 Write color index to Visio shapesheet via VB?

I'm having a hard time coordinating colors between a VB-authored
control, and the Visio shapesheet of the shape that contains it. I can
certainly get colors from the shapesheet, call the required Red(),
Green(), and Blue() functions, and create an OLE_COLOR variable from
them.

The tough(er) part is to let the user choose colors from the control's
property page (standard ForeColor and BackColor pages), and push the
respective value to the Visio shapesheet. To properly coordinate this, I
suspect I need to set the control's palette to the same as the Visio
document. I _believe_ I have done this by setting UserControl.Palette =
Ambient.Palette. I have also set the UserControl.PaletteMode property =
vbPaletteModeContainer.

What I seem to be missing (mostly, I think) is how to derive the chosen
Index number from the palette displayed (which assumes that I correctly
got the Palette from Visio in the first place.

Any/All help appreciated!

Mike Schoonmaker



Thu, 06 Mar 2003 03:00:00 GMT  
 Write color index to Visio shapesheet via VB?

Correction to last post:

I incorrectly stated "UserControl.Palette = Ambient.Palette", which is
an Ambient property that is not supported. I can still, however, use
UserControl.PaletteMode property = vbPaletteModeContainer.

Mike

Quote:
-----Original Message-----

I'm having a hard time coordinating colors between a VB-authored
control, and the Visio shapesheet of the shape that contains it. I can
certainly get colors from the shapesheet, call the required Red(),
Green(), and Blue() functions, and create an OLE_COLOR variable from
them.

The tough(er) part is to let the user choose colors from the control's
property page (standard ForeColor and BackColor pages), and push the
respective value to the Visio shapesheet. To properly coordinate this, I
suspect I need to set the control's palette to the same as the Visio
document. I _believe_ I have done this by setting UserControl.Palette =
Ambient.Palette. I have also set the UserControl.PaletteMode property =
vbPaletteModeContainer.

What I seem to be missing (mostly, I think) is how to derive the chosen
Index number from the palette displayed (which assumes that I correctly
got the Palette from Visio in the first place.

Any/All help appreciated!

Mike Schoonmaker



Fri, 07 Mar 2003 03:00:00 GMT  
 Write color index to Visio shapesheet via VB?

Turns out, if I write the RGB(r,g,b) formula to the shapesheet, it
resolves itself into an index. In fact, creating a new index if
necessary.

Mike Schoonmaker



Sat, 08 Mar 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Visio Shapesheet Bug

2. Creating Indexes & Relations via VB Code

3. upgrade the VB program from Visio 5 to Visio 2000

4. Bitmap Color Info via VB-Function?

5. unable to write to MDB via VB + ODBC API

6. GPF when VB writes to Excel via OLE

7. WANTED: Trying to write VB prog to send video via modem to a viewer

8. writing HTML form content to Microsoft Outlook via VB in ASP page

9. Q: How to write an excel sheet in VB - exporting .bmps and colors

10. Help with writing Datagrid Contents back to EXCEL via VB.NET

11. Visio in VB6 via OLE = long delay before screen updates

12. Add color button is visio

 

 
Powered by phpBB® Forum Software