ArcObjects Library Reference (Controls)  

IToolbarControl2.LoadItems Method

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

Product Availability

Available with ArcGIS Engine.

Description

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. 

Errors Returned

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

[C#]

IBlobStream blobStream = new MemoryBlobStreamClass();
IStream stream = (IStream) blobStream;
blobStream.LoadFromFile(@"C:\temp\myCustomToolbarControl");
axToolbarControl1.LoadItems(stream);

[Visual Basic .NET]

Dim blobStream As IBlobStream = New MemoryBlobStreamClass
Dim stream As IStream = blobStream
blobStream.LoadFromFile("C:\temp\myCustomToolbarControl")
AxToolbarControl1.LoadItems(blobStream)

See Also

IToolbarControl2 Interface

.NET Snippets

Load ToolbarControl Items from File |

.NET Related Topics

How to save ToolbarControl items to a settings file |