Skip to content

CreateAsXML Method

Description

Sets the location of the XML file to load/save the information to/from and it also determines if the information will be loaded or saved to the file.

Syntax

Public Function CreateAsXML( _
    ByVal Loading As Boolean, _
    ByVal Section As String _
) As Boolean

Parameters

Set to False to make the GetSection, ExchangeInt, and ExchangeString methods save data to a data source. The information saved will be saved under the Section specified in the Section parameter.

  • Section
    The name of a layout to load or save from/to a data source.

Return Type

Returns True if successful, False otherwise.

Remarks

There are three ways to save and load layout/state information to a PropExchange object. You can load and save information to the system registry, an XML file, or a binary file. The CreateAsBinary, CreateAsRegistry, and CreateAsXML methods are used to specify whether to save or load the layout/state information and the location of the layout/state information (path to XML or Bin file, Registry Key). Note this does not actually load/save the information; it just indicates the location to load/save the information to/from and if it will be loaded/saved.

When using any of the CreateAs methods, the Loading parameter is used to specify whether the layout information is currently Loading or saving. The Loading property will be True until set to False by calling a CreateAs method and passing False as the Loading parameter. The Loading property can be used to determine if you are currently loading layout information.

The DoPropExchange method is used to actually load or save the information to a file or the registry.

When saving information, the Valid property should be used after a call to one of the CreateAs methods to verify that the layout information was correctly saved to the PropExchange object.

When loading information, the LoadFromFile method can be used to verify and load the information at the same time.

The Encoding property is provided for Unicode support when working with XML files.

The Value property is used when working with XML data. The Value will always contain the layout and state of the control in XML format. The Value is intended to be used to manually create or get the layout in XML format. This can be used to manually read/write the layout information directly to/from the Value property if you don't want to save to a file.

See Also

Example


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.