System.InvalidCastException Error when running code

C

cmdolcet69

In the below code exact line If _graphicScreenShots(intloop) =
"Summary" Then....... I get an error message

Overload resolution failed because no Public '=' can be called with
these arguments:
'Public Shared Operator =(a As String, b As String) As Boolean':
Argument matching parameter 'a' cannot convert from 'Bitmap'
to 'String'.


Code:

//
**********************************************************************************************************************
Private Sub AddSummaryInformation()
If _graphicScreenShots.Count > 0 Then
Dim intloop As Integer
For intloop = 0 To _graphicScreenShots.Count - 1


If _graphicScreenShots(intloop) = "Summary" Then



Dim transaction As
System.ComponentModel.Design.DesignerTransaction =
host.CreateTransaction("Drop Field")
Try
Dim report As
DevExpress.XtraReports.UI.XtraReport = reportDesigner.RootReport
Dim tmpPicBox As
DevExpress.XtraReports.UI.XRControl =
DevExpress.XtraReports.Design.FieldDragHandler.CreateXRControl(GetType(XRPictureBox),
reportDesigner.RootReport.Bands(DevExpress.XtraReports.UI.BandKind.Detail),
New System.Drawing.Point(0, 0), Nothing, reportDesigner.SnapToGrid,
reportDesigner.GridSize)

With CType(tmpPicBox, XRPictureBox)
.Image = _graphicScreenShots(intloop + 1)
.Sizing =
DevExpress.XtraPrinting.ImageSizeMode.StretchImage
.Tag = "Summary Graphic"
End With

myNC.ControlName = "picSummary"
AddToContainer(host, tmpPicBox)
Catch ex As Exception
_TListener.AddMethodError(ex)
Finally
transaction.Commit()
End Try

Exit For
End If
Next
End If
End Sub
 
R

Robin Tucker

Hi,

Presumably _graphicScreenShots is an array of bitmaps? You can't compare a
bitmap to "string".





Robin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top