Copyright © 2003-2024 MultiMedia Soft

How to use Enumerations

Previous pageReturn to chapter overviewNext page

The use of Enumerations (also known as "enumerated types") is very important because gives more readability to your code: for this purpose we have provided a set of public Enumerations.

Here follows the full list of Enumerations with the associated properties; in order to see the values defined by the Enumerations and to understand their meaning, click the associated property:

Enumerated type

Related properties

 

 

Ctl3d.Shapes

Shape

Ctl3d.Surfaces

Surface

Ctl3d.SpecialEffects

SpecialEffect

Ctl3d.FrameEffects

FrameEffect

Ctl3d.TranspModes

PictureTranspMode

Ctl3d.Grades

Slant and FlatPillowFactor

Ctl3d.SpecialEffectsFactors

SpecialEffectFactor

Ctl3d.Orientations

Orientation

Ctl3d.Smooths

SmoothEdges

Ctl3d.ShadowModes

ShadowMode

Ctl3d.TextEffects

TextDescriptor.SpecialEffect

Ctl3d.ColorRenderType

SurfaceColor.Render3DType

Ctl3d.ColorGradientType

SurfaceColor.GradientType

Ctl3d.TextureModes

Texture.Mode

Ctl3d.CaptionAlign

TextCaptionAlignment

Ctl3d.FocusModes

FocusMode

Ctl3d.PictPositions

PicturePosition

Ctl3d.ExportImage

ExportBtnImage method

Ctl3d.ExportFormat

ExportBtnImage method

Ctl3d.Sounds

EnableSound and SetSoundSync methods

Ctl3d.TplBinTypes

SetTemplateBinDir method

Ctl3d.Pictures

SetPictureFromHandle and CellsManager.SetPictureFromHandle methods

Ctl3d.TranspZones

SurfaceTransparentZone

Ctl3d.LightDirections

LightDirection

Ctl3d.HorzAlign

CellsManager.TextHorzAlign and CellsManager.PictureHorzAlign

Ctl3d.VertAlign

CellsManager.TextVertAlign and CellsManager.PictureVertAlign

Ctl3d.SpotlightTypes

SpotlightType

Ctl3d.ScaleUnits

CellsManager.ScaleUnit

Ctl3d.VistaLooks

VistaLook

Ctl3d.VistaGlossyShapes

VistaGlossyShape

Ctl3d.ProgressBarTypes

ProgressBarType

Ctl3d.ProgressBarFillModes

ProgressBarFillMode

Ctl3d.SplitButtonTypes

SplitButtonType

 

SAMPLES

Here follows a brief sample of the operations needed in order to make use of Enumerations in your code inside the various development environments we have used to test our control; the samples suppose that you have inserted one instance of the control (named MyControl) inside a form and, at runtime inside the Form_Load subroutine, you need to change its shape from the Rectangle default to Ellipse.

Microsoft Visual Basic.NET

Microsoft Visual C#.NET

Microsoft Visual J#.NET

 

 

Microsoft Visual Basic.NET

 

With this environment we can easily use the IntelliSense features that will help us assigning the correct value to the Shape property; after having inserted the code

MyControl.Shape

press the '=' character on your keyboard and you will see the IntelliSense display the listbox of the possible values that can be assigned to the Shape property

 

3dcm_i0000c6

 

select the Ctl3d.Shapes.Ellipse value so the complete line of code will be:

MyControl.Shape = Ctl3d.Shapes.Ellipse

 

Microsoft Visual C#.NET

 

Inside this environment the IntelliSense features are less powerful than inside VB.NET, so we need a couple of line of code that were not needed with the previous environment; first of all we need to insert the following line of code at the beginning of the form management file

using Ctl3d;

this line of code will add the to the existing namespaces our component namespace.

After having inserted the code

MyControl.Shape

you will see that pressing the '=' character, unfortunately no IntelliSense will be displayed: we need to help the environment with a further information about the kind of value we want to enter; the Shape property, as you will see inside the table at the beginning of this section, is associated to the Ctl3d.Shapes enumerated type, so let's try to enter some more character inside our line of code; after having inserted the code

MyControl.Shape = Shapes   // Ctl3d. is not needed because we have already "using Ctl3d;"

press the dot '.' character and you will see the IntelliSense display the listbox of the values declared inside the Ctl3d.Shapes enumerated type

3dcm_i0000c7

select the Shapes.Ellipse value so the complete line of code will be:

MyControl.Shape = Shapes.Ellipse;

 

Microsoft Visual J#.NET

 

Also with this environment, with some difference, we can use the IntelliSense features; after having inserted the code

MyControl

you will see that pressing the dot '.' character the IntelliSense will display the available wrapper functions to access the properties of the control; in our case we must scroll until we find the set_Shape function as displayed on the image below:

3dcm_i0000c8

as you can see, the tooltip on the right of the listbox helps us understanding which enumerated type must be assigned to the property, so let's go ahead with the line of code

MyControl.set_Shape (Ctl3d.Shapes

press the dot '.' character and you will see the IntelliSense display the listbox of the values declared inside the Ctl3d.Shapes enumerated type

3dcm_i0000c9

select the Ellipse value so the complete line of code will be:

MyControl.set_Shape (Ctl3d.Shapes.Ellipse);