Click here to Skip to main content
15,917,538 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Error binding picture box? Pin
Dave Kreskowiak24-Jun-04 2:52
mveDave Kreskowiak24-Jun-04 2:52 
GeneralRe: Error binding picture box? Pin
mythinky24-Jun-04 18:42
mythinky24-Jun-04 18:42 
GeneralRe: Error binding picture box? Pin
Dave Kreskowiak25-Jun-04 1:20
mveDave Kreskowiak25-Jun-04 1:20 
GeneralRe: Error binding picture box? Pin
mythinky28-Jun-04 15:45
mythinky28-Jun-04 15:45 
GeneralRe: Error binding picture box? Pin
Dave Kreskowiak28-Jun-04 17:05
mveDave Kreskowiak28-Jun-04 17:05 
GeneralRe: Error binding picture box? Pin
mythinky28-Jun-04 17:21
mythinky28-Jun-04 17:21 
GeneralRe: Error binding picture box? Pin
Dave Kreskowiak29-Jun-04 1:04
mveDave Kreskowiak29-Jun-04 1:04 
GeneralRe: Error binding picture box? Pin
mythinky30-Jun-04 15:31
mythinky30-Jun-04 15:31 
This is the error:

An unhandled exception of type 'System.InvalidCastException' occured in mscorlib.dll

Addtional information: Inavalid cast from System.String to String.Drawing.Image



This error occur on the following code:
Dim oFrmBookDetails = New frmBookDetails()
oFrmBookDetails.MdiParent = Me
oFrmBookDetails.Show() 'This is where the error occur. 'I know it from highlighted code when the error occurs.

Try
Dim b As Binding = New Binding("Image", objDView, "CoverSample")
AddHandler b.Format, AddressOf MyPictureBox_FormatImage
picBook.DataBindings.Add(b)
Catch ex As InvalidCastException
MsgBox(ex.Message, , "BindFields")
End Try

Every time i set the breakpoint, if i press F8, it will step into "Dim b As Binding...", then "AddHandler..." without going to "Adrressof MyPictureBox_FormatImage", after that "picBook.DataBindings.Add(b)", then step into "oFrmBookDetails.Show()". When showing, it execute the "MyPictureBox_FormatImage" procedure.
I think it should be execute the "MyPictureBox_FormatImage" first, then step into "oFrmBookDetails.Show()". How come it step into "oFrmBookDetails.Show()" first, then going into "MyPictureBox_FormatImage" procedure.

Learning .NET
GeneralRe: Error binding picture box? Pin
Dave Kreskowiak1-Jul-04 1:32
mveDave Kreskowiak1-Jul-04 1:32 
GeneralRe: Error binding picture box? Pin
mythinky5-Jul-04 15:26
mythinky5-Jul-04 15:26 
GeneralRe: Error binding picture box? Pin
Dave Kreskowiak6-Jul-04 23:49
mveDave Kreskowiak6-Jul-04 23:49 
GeneralRe: Error binding picture box? Pin
mythinky11-Jul-04 23:04
mythinky11-Jul-04 23:04 
QuestionError send email? Pin
mythinky16-Jun-04 16:03
mythinky16-Jun-04 16:03 
AnswerRe: Error send email? Pin
Dave Kreskowiak17-Jun-04 3:24
mveDave Kreskowiak17-Jun-04 3:24 
GeneralRe: Error send email? Pin
mythinky17-Jun-04 22:02
mythinky17-Jun-04 22:02 
AnswerRe: Error send email? Pin
Aaron Eldreth17-Jun-04 4:16
Aaron Eldreth17-Jun-04 4:16 
Generalput icon Context Menu on File selection Pin
skoizumi2911016-Jun-04 12:59
sussskoizumi2911016-Jun-04 12:59 
GeneralRe: put icon Context Menu on File selection Pin
tramdtt16-Jun-04 14:38
tramdtt16-Jun-04 14:38 
GeneralRe: put icon Context Menu on File selection Pin
vancouver77716-Jun-04 14:40
vancouver77716-Jun-04 14:40 
GeneralRe: put icon Context Menu on File selection Pin
tramdtt16-Jun-04 15:55
tramdtt16-Jun-04 15:55 
GeneralRe: put icon Context Menu on File selection Pin
shinay16-Jun-04 19:22
shinay16-Jun-04 19:22 
GeneralRe: put icon Context Menu on File selection Pin
tramdtt16-Jun-04 20:43
tramdtt16-Jun-04 20:43 
GeneralRe: put icon Context Menu on File selection Pin
grigri17-Jun-04 1:07
grigri17-Jun-04 1:07 
GeneralRTF control Pin
PaleyX16-Jun-04 12:57
PaleyX16-Jun-04 12:57 
GeneralRe: RTF control Pin
Dave Kreskowiak17-Jun-04 3:18
mveDave Kreskowiak17-Jun-04 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.