Table of Contents

Struct FormError

Namespace
RDCore.Forms.Model
Assembly
RDCore.Forms.dll

A run-time error a form or a control answers with: VB's error number, and its standard description.

public readonly record struct FormError : IEquatable<FormError>
Implements
Inherited Members

Remarks

A control refuses a value, a member or a call with the error VB raises for it, such as 380 for a value outside a property's range. The code that runs the form raises it in the program, where Err.Number reads Number.

Each static property of this type makes its error with the description in the current UI culture, such as "Invalid property value" in English and "Valeur de propriété incorrecte" in French.

Constructors

FormError(int, string)

A run-time error a form or a control answers with: VB's error number, and its standard description.

public FormError(int Number, string Description)

Parameters

Number int

The error's number, as Err.Number reads it.

Description string

The error's description, as Err.Description reads it.

Remarks

A control refuses a value, a member or a call with the error VB raises for it, such as 380 for a value outside a property's range. The code that runs the form raises it in the program, where Err.Number reads Number.

Each static property of this type makes its error with the description in the current UI culture, such as "Invalid property value" in English and "Valeur de propriété incorrecte" in French.

Properties

ArgumentNotOptional

Error 449, "Argument not optional".

public static FormError ArgumentNotOptional { get; }

Property Value

FormError

CanOnlyRemoveAddedControls

Error 729, "Controls.Remove can only remove controls added with Controls.Add".

public static FormError CanOnlyRemoveAddedControls { get; }

Property Value

FormError

CantLoadOrUnloadThisObject

Error 361, "Can't load or unload this object".

public static FormError CantLoadOrUnloadThisObject { get; }

Property Value

FormError

CantUnloadControlsCreatedAtDesignTime

Error 362, "Can't unload controls created at design time".

public static FormError CantUnloadControlsCreatedAtDesignTime { get; }

Property Value

FormError

CantUseSeparatorBarAsMenuName

Error 395, "Cannot use separator bar as menu name for this control": a menu's Caption set to a hyphen.

public static FormError CantUseSeparatorBarAsMenuName { get; }

Property Value

FormError

ControlRemoved

Error 735, "The control is no longer usable because it has been removed from the controls collection".

public static FormError ControlRemoved { get; }

Property Value

FormError

Description

The error's description, as Err.Description reads it.

public string Description { get; init; }

Property Value

string

DeviceUnavailable

Error 68, "Device unavailable".

public static FormError DeviceUnavailable { get; }

Property Value

FormError

FileNotFound

Error 53, "File not found".

public static FormError FileNotFound { get; }

Property Value

FormError

GetNotSupportedAtRuntime

Error 393, "Get not supported at runtime": a property a program cannot read while it runs.

public static FormError GetNotSupportedAtRuntime { get; }

Property Value

FormError

InvalidControlArrayIndex

Error 341, "Invalid control array index": a negative index given to Load for an element of a control array of controls other than menus, as VB6 words it for them.

public static FormError InvalidControlArrayIndex { get; }

Property Value

FormError

InvalidObjectArrayIndex

Error 341, "Invalid object array index": a negative index given to Load.

public static FormError InvalidObjectArrayIndex { get; }

Property Value

FormError

InvalidObjectUse

Error 425, "Invalid object use".

public static FormError InvalidObjectUse { get; }

Property Value

FormError

InvalidPicture

Error 481, "Invalid picture".

public static FormError InvalidPicture { get; }

Property Value

FormError

InvalidProcedureCall

Error 5, "Invalid procedure call or argument".

public static FormError InvalidProcedureCall { get; }

Property Value

FormError

InvalidPropertyArrayIndex

Error 381, "Invalid property array index".

public static FormError InvalidPropertyArrayIndex { get; }

Property Value

FormError

InvalidPropertyValue

Error 380, "Invalid property value".

public static FormError InvalidPropertyValue { get; }

Property Value

FormError

InvalidUseOfNull

Error 94, "Invalid use of Null".

public static FormError InvalidUseOfNull { get; }

Property Value

FormError

MethodOrDataMemberNotFound

Error 461, "Method or data member not found".

public static FormError MethodOrDataMemberNotFound { get; }

Property Value

FormError

NamedArgumentNotFound

Error 448, "Named argument not found".

public static FormError NamedArgumentNotFound { get; }

Property Value

FormError

NoSuchInterface

Error -2147467262 (&H80004002), "System Error &H80004002 (-2147467262). No such interface supported": the object is not of the kind asked for, such as the name of a control array given to Controls.Remove.

public static FormError NoSuchInterface { get; }

Property Value

FormError

Number

The error's number, as Err.Number reads it.

public int Number { get; init; }

Property Value

int

ObjectAlreadyLoaded

Error 360, "Object already loaded".

public static FormError ObjectAlreadyLoaded { get; }

Property Value

FormError

ObjectDoesntSupportPropertyOrMethod

Error 438, "Object doesn't support this property or method".

public static FormError ObjectDoesntSupportPropertyOrMethod { get; }

Property Value

FormError

ObjectNotAnArray

Error 343, "Object not an array".

public static FormError ObjectNotAnArray { get; }

Property Value

FormError

ObjectVariableNotSet

Error 91, "Object variable or With block variable not set": such as a Data control's UpdateRecord with no recordset.

public static FormError ObjectVariableNotSet { get; }

Property Value

FormError

Overflow

Error 6, "Overflow".

public static FormError Overflow { get; }

Property Value

FormError

PathNotFound

Error 76, "Path not found".

public static FormError PathNotFound { get; }

Property Value

FormError

SetNotSupportedAtRuntime

Error 382, "Set not supported at runtime": a property a program cannot assign while it runs.

public static FormError SetNotSupportedAtRuntime { get; }

Property Value

FormError

SetNotSupportedReadOnly

Error 383, "Set not supported (read-only property)".

public static FormError SetNotSupportedReadOnly { get; }

Property Value

FormError

TypeMismatch

Error 13, "Type mismatch".

public static FormError TypeMismatch { get; }

Property Value

FormError

WrongNumberOfArguments

Error 450, "Wrong number of arguments or invalid property assignment".

public static FormError WrongNumberOfArguments { get; }

Property Value

FormError

Methods

ContainerHoldsADesignTimeControl(string)

Error 740, "Controls.Remove can only remove container controls that contain controls added with Controls.Add. 'name' was not added with Controls.Add.": a container that holds a control placed at design time.

public static FormError ContainerHoldsADesignTimeControl(string name)

Parameters

name string

The name of the control placed at design time.

Returns

FormError

The error.

ControlArrayElementDoesntExist(int)

Error 340, "Control array element 'index' doesn't exist": an element of a control array that is not loaded.

public static FormError ControlArrayElementDoesntExist(int index)

Parameters

index int

The element's index.

Returns

FormError

The error.

ControlNameTaken(string)

Error 727, "There is already a control with the name 'name'".

public static FormError ControlNameTaken(string name)

Parameters

name string

The name, as the program gave it.

Returns

FormError

The error.

ControlNotFound(string)

Error 730, "Control 'name' not found".

public static FormError ControlNotFound(string name)

Parameters

name string

The name, as the program gave it.

Returns

FormError

The error.

InvalidClassString(string)

Error 711, "Invalid class string. Looking for object with ProgID: progId": a class that Controls.Add does not know.

public static FormError InvalidClassString(string progId)

Parameters

progId string

The class's name, as the program gave it.

Returns

FormError

The error.

NotALegalControlName(string)

Error 728, "'name' is not a legal control name".

public static FormError NotALegalControlName(string name)

Parameters

name string

The name, as the program gave it.

Returns

FormError

The error.

NotAValidControlContainer(string)

Error 721, "'className' is not a valid control container": a control that holds no controls, given to Controls.Add as a container.

public static FormError NotAValidControlContainer(string className)

Parameters

className string

The would-be container's class name, such as CommandButton.

Returns

FormError

The error.

NotAValidControlType(string)

Error 720, "'className' is not a valid control type": a class Controls.Add makes no control of, such as a menu or a form.

public static FormError NotAValidControlType(string className)

Parameters

className string

The class's name, such as Menu.

Returns

FormError

The error.

PropertyCantBeSetOnThisControl(string)

Error 387, "'property' property can't be set on this control": a value the property takes, refused on this component, such as Checked on a top-level menu.

public static FormError PropertyCantBeSetOnThisControl(string property)

Parameters

property string

The property's name.

Returns

FormError

The error.

PropertyIsReadOnly(string)

Error 383, "'name' property is read-only": the description VB6 gives an assignment to a control's read-only property, such as a ListBox's ListCount.

public static FormError PropertyIsReadOnly(string name)

Parameters

name string

The property's name.

Returns

FormError

The error.

PropertyNotSetAtRuntime(string)

Error 382, "Could not set the name property. Can not set property at runtime.": the description Microsoft Forms 2.0 gives an assignment of a property a program cannot set while it runs, such as the Name of a control of the form's file.

public static FormError PropertyNotSetAtRuntime(string name)

Parameters

name string

The property's name.

Returns

FormError

The error.

ToString()

The error's number and description, such as 380: Invalid property value.

public override string ToString()

Returns

string

The error's number and description.