or
Me.pnMap = New Telerik.WinControls.Docking.DocumentPane
Dim oMap As New MapPoint.MappointControl
Me.pnMap.Controls.Add(oMap)
The following error occurs:
Unable to cast COM object of type 'MapPoint.MappointControlClass' to class type 'System.Windows.Forms.Control'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
If I embed the control from the toolbox at design time everything works fine, so could you please help me with this?
Regards,
private int GetTabIndex(RadElement Item) {...but that can't be the solution. ;-)
int i = 0;
foreach(RadElement E in fTab.Items) {
if (E == Item) return i;
i++;
}
return -1;
}