Formatting the Control in a Document

The default appearance of the control can vary based on the document in which it resides. This is because the control takes the ambient properties of the document in which it is running. For example, when placed in Microsoft Word or FrontPage, the graph background, font, and chart background color might be reset to the default color and font used by those documents. Therefore, after you insert the control in a Microsoft Office application, you might want to change its appearance with respect to the document itself.

Using Design mode in Visual Basic or Office documents, you can easily manipulate the control's attributes such as size, position, and so on as you could with any linked or embedded object. In addition, you have access to the control's properties, methods, and events from the Visual Basic editor for programming the control's behavior within the document. (The control's user interface is inactive when the document is in Design mode.) Note that there are slight differences in how some of the Office applications handle formatting the inserted control.


note-icon

Note

When changing the properties of the control, it is possible to set colors for BackColor, ForeColor, or GraphBackground, or to set graph line colors that are not visible. Therefore, make sure to check the appearance of your control display after you make changes to its properties.

In addition, you cannot programmatically format the properties and methods of the control using the Visual Basic editor. Use VBScript or Jscript® in your HTML editor for this purpose.

To format the control in a document

  1. Resume Design mode and make the changes you want. To resume Design mode in PowerPoint, exit the Slide Show view.
    • To change the position of the control in the document, drag the control to another position in the container.
    • To change the height or width of the control in the document, drag one of the selection handles of the control in the appropriate direction.
  2. To access the control properties or the Visual Basic code editor, right-click the control and select Properties or View Code, as appropriate. In the Visual Basic code editor window, you can view the Object Browser if needed.

    Notice that some commands on this shortcut menu (such as Cut, Copy, or Paste) are designed for other embedded or linked objects in that document; they are not relevant to the control and might be unavailable (dimmed).


note-icon

Note

When you use Microsoft Office applications, it is possible to modify the control in the document so that the control's properties become inaccessible. This occurs because the control is being converted into an embedded object. For example, if you click the System Monitor Control Object command in Microsoft Word (by right-clicking the control) and select the Convert command, the Convert dialog box appears. If you click OK in this box, the control's properties and view-code option become unavailable. You will not be able to change the position or the size of the object in Word.

  1. Exit Design mode before trying to add counters or to edit the control's default properties.

Notice that the appearance of the control might not update properly until you exit Design mode.

For information about the control's objects, properties, and so on, see the Software Development Kit (SDK) documentation in the MSDN Library at http://windows.microsoft.com/windows2000/reskit/webresources.

© 1985-2000 Microsoft Corporation. All rights reserved.



Microsoft Corporation Staff, IT Professional Staff - Microsoft Windows 2000 Server Operations Guide
Microsoft Corporation Staff, IT Professional Staff - Microsoft Windows 2000 Server Operations Guide
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 404

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net