How to Use a Linked Paintbrush Object with OLECLIEN.VBXLast reviewed: June 21, 1995Article ID: Q86776 |
The information in this article applies to:
- Professional Edition of Microsoft Visual Basic for Windows, version 2.0 - Microsoft Professional Toolkit for Microsoft Visual Basic programming system for Windows, version 1.0
SUMMARYThe following example program demonstrates how to use the Visual Basic OLE Client (OLECLIEN.VBX) custom control to create a linked Paintbrush object. The following OLEClient property settings are required to create a Paintbrush Object Linking and Embedding (OLE) object:
Class - "PBrush" SourceDoc - The full path of a bitmap file to use (for example, c:\windows\arches.bmp). SourceItem - A string containing the pixel coordinates of the part of the bitmap to display. These coordinates should be in the format "x1 y1 x2 y2".This information applies to the OLECLIEN.VBX custom control in Visual Basic. Note that Windows version 3.0 Paintbrush does not support OLE; you must have Windows version 3.1 in order to use this example.
MORE INFORMATIONThe following program demonstrates how to create a linked Paintbrush object in Visual Basic using the OLECLIEN.VBX custom control.
Step-by-Step Example1. Start Visual Basic or from the File menu, choose New Project (ALT, F, N)if Visual Basic is already running. Form1 is created by default.
Sub Command1_Click() OLEClient1.Class = "PBrush" OLEClient1.Protocol = "StdFileEditing" OLEClient1.SourceDoc = "c:\windows\arches.bmp" ' The SourceItem for Paintbrush is the coordinates of ' of an object image in bitmap - "x1 y1 x2 y2". OLEClient1.SourceItem = "0 0 121 159" OLEClient1.ServerType = 0 ' Linked. OLEClient1.Action = 1 ' CreateFromFile. Command1.Enabled = 0 End Sub Sub OleClient1_DblClick () OLEClient1.Action = 7 ' Activate (open for editing). End Sub Sub Form_Unload (Cancel As Integer) OLEClient1.Action = 9 ' Close (terminate connection). End Sub
REFERENCES"Microsoft Professional Toolkit for Visual Basic: Custom Control Reference" Pages 196-232
|
Additional reference words: 1.00 2.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |