This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IT > IToolbarControl2 Interface > IToolbarControl2.LoadItems Method (ArcObjects .NET 10.5 SDK) |
Loads items into the ToolbarControl from a previously saved stream.
[Visual Basic .NET] Public Sub LoadItems ( _ ByVal pStream As IStream _ )
[C#] public void LoadItems ( IStream pStream );
[C++]
HRESULT LoadItems(
IStream* pStream
);
[C++]
Parameters pStream [in]
pStream is a parameter of type IStream
Loads the specified items into the ToolbarControl. Any items on the ToolbarControl before the LoadItems method is used, will be removed and replaced by the contents of the stream.
Use the LoadItems method in conjunction with the IBlobStream::LoadFromFile method to load any previously saved customizations made to the ToolbarControl by a user with the CustomizeDialog. The stream can be saved into a users profile using the SaveItems method, when an application exits, and the items loaded back into the ToolbarControl when the application is restarted using the LoadItems method.
1029 800a0405: Version incompatibility when loading from a stream, the stream version is ahead of the current software version
1076 800a0434: The supplied stream format is not recognized as containing ToolbarControl item
IBlobStream blobStream=new
MemoryBlobStreamClass();
IStream stream=(IStream) blobStream;
blobStream.LoadFromFile(@"C:\temp\myCustomToolbarControl");
axToolbarControl1.LoadItems(stream);
Dim
blobStreamAs
IBlobStream=New
MemoryBlobStreamClassDim
streamAs
IStream=blobStream blobStream.LoadFromFile("C:\temp\myCustomToolbarControl") AxToolbarControl1.LoadItems(blobStream)