When using the ImageKit8 ActiveX in VisualBasic.NET or VisualC#.NET, some of the controls' property, method, or event names must be changed. The following is an explanation of how the ImageKit can be used in these environments.
Note: In VisualStudio 2002/2003 some property names, method names, or event names will change but in VisualStudio 2005/2008/2010, only property or event names need to be modified. Method names will not change.
ImageKit Control (ImageKit8.ocx)
Properties
MouseWheel --> CtlMouseWheel
Raster --> get_Raster
Vector --> get_Vector
Methods
Refresh --> CtlRefresh
Events
PanWindow --> PanWindowEvent
Thumbnail Control (ImageKit8Thumb.ocx)
Properties
Text --> CtlText
Methods
Refresh --> CtlRefresh
There is a problem using the VisualBasic.NET Upgrade Wizard to convert VisualBasic programs that include some Print properties, namely properties that have the term "Font" in their name. When the Visual Basic Print sample was converted to VisualBasic.NET for example, the FontName property was changed to the System.Drawing. Font class but did not function correctly. After converting the program, it is necessary to manually change it back to "FontName". Other Print properties that fall into this type of error are: FontBold, FontItalic, FontName, FontSize, FontStrikeOut, and FontUnderline
Regarding Events
Parameter structures in .NET framework are somewhat different.
Please refer to the following example:
ImageKit Control's EndDispImage Event
Syntax
In Visual Basic:
imagekitcontrolname_EndDispImage(ByVal OriginX As
Long, ByVal OriginY As Long, ByVal Left As Long, ByVal Top As Long,
ByVal Right As Long, ByVal Bottom As Long, ByVal ScaleWidth As
Double, ByVal ScaleHeight As Double)
In Visual Basic.NET:
imagekitcontrolname_EndDispImage(ByVal sender As
Object, ByVal e As
AxImageKit8Lib._IImageKitEvents_EndDispImageEvent)
In Visual C#.NET:
imagekitcontrolname_EndDispImage(object sender,
AxImageKit8Lib._IImageKitEvents_EndDispImageEvent e)
Comparing Visual Basic 6 syntax with VB.NET and C#.NET you will see
that parameters must be changes from OriginX to e.originX, OriginY
to e.originY, Left to e.left, Top to e.top, Right to e.right,
Bottom to e.bottom, ScaleWidth to e.scaleWidth, and ScaleHeight to
e.scaleHeight.
The above explanation applies to all events within the ImageKit
Control which is contained in the ImageKit8.ocx and denoted by
AxImageKit8Lib. However, when using the Slideshow Control or
the Thumbnail Control, the denotation, AxImageKit8Lib, must
be changed as follows:
Slideshow Control: AxImageKit8SLIDELib
Thumbnail Control: AxImageKit8THUMBLib
Regarding Constants
In .NET, setting constants used in properties and methods is
somewhat different. Please refer to the folling example:
ImageKit Control's Appearance property
Syntax
In Visual Basic:
imagekitcontrolname.Appearance [ =
AppearanceConstants ]
In Visual Basic.NET:
imagekitcontrolname.Appearance [ =
ImageKit8Lib.AppearanceConstants ]
In Visual C#.NET:
imagekitcontrolname.Appearance [ =
ImageKit8Lib.AppearanceConstants ]
To set this property
In Visual Basic:
imagekitcontrolname.Appearance = ikFlat
In Visual Basic.NET:
imagekitcontrolname.Appearance =
ImageKit8Lib.AppearanceConstants.ikFlat
In Visual C#.NET:
imagekitcontrolname.Appearance =
ImageKit8Lib.AppearanceConstants.ikFlat;
The above explanation applies to all events within the ImageKit
Control which is contained in the ImageKit8.ocx and denoted by
AxImageKit8Lib. However, when using the Slideshow Control or
the Thumbnail Control, the denotation, AxImageKit8Lib, must
be changed as follows:
Slideshow Control: AxImageKit8SLIDELib
Thumbnail
Control: AxImageKit8THUMBLib
Regarding parameter and return value types for properties,
methods, and events
In Visual Basic 6, types Integer and Long become
Short and Integer respectively in Visual Basic.NET.
In Visual C# types are almost always the same as C++Builder and
Visual C++, except for long which in C# is int.
For example, the ImageKit Control's ErrorStatus property
Syntax
In Visual Basic:
imagekitcontrolname.ErrorStatus [ = Integer ]
In Visual Basic.NET:
imagekitcontrolname.ErrorStatus [ = Short ]
In Visual C#.NET:
imagekitcontrolname.ErrorStatus [ = short ]
the ImageKit Control's ErrorStatus property
Syntax
In Visual Basic:
imagekitcontrolname.ImageHandle [ = Long ]
In Visual Basic.NET:
imagekitcontrolname.ImageHandle [ = Integer ]
In Visual C#.NET:
imagekitcontrolname.ImageHandle [ = int ]