hi all,
i have a form with a tabcontrol with 4 pages. on the first page are many
controls bound to a database. now i bound the controls of page two (two
multiline textboxes, four SelectedValues) to the db. the program compiles
without an error and runs fine, until i click on tabpage 2. then the program
throws the following exception:
System.Argument Exception: Der Objekttyp kann nicht zum Zieltyp konvertiert
werden. (english: Object type cannot be converted to target type)
at System.Windows. Forms.Control.S etVisibleCore(B oolean value)
at System.Windows. Forms.Control.s et_Visible(Bool ean value)
at System.Windows. Forms.TabPage.s et_Visible(Bool ean value)
at System.Windows. Forms.TabContro l.UpdateTabSele ction(Boolean uiselected)
at System.Windows. Forms.TabContro l.OnSelectedInd exChanged(Event Args e)
at System.Windows. Forms.TabContro l.WmSelChange(M essage& m)
at System.Windows. Forms.TabContro l.WndProc(Messa ge& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows. Forms.UnsafeNat iveMethods.Send Message(HandleR ef hWnd,
Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows. Forms.Control.S endMessage(Int3 2 msg, IntPtr wparam,
IntPtr lparam)
at System.Windows. Forms.Control.R eflectMessageIn ternal(IntPtr hWnd,
Message& m)
at System.Windows. Forms.Control.W mNotify(Message & m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows. Forms.UnsafeNat iveMethods.Call WindowProc(IntP tr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows. Forms.NativeWin dow.DefWndProc( Message& m)
at System.Windows. Forms.Control.D efWndProc(Messa ge& m)
at System.Windows. Forms.Control.W mMouseDown(Mess age& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.TabContro l.WndProc(Messa ge& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G& msg)
at
System.Windows. Forms.Component Manager.System. Windows.Forms.U nsafeNativeMeth ods+IMsoCompone ntManager.FPush MessageLoop(Int 32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows. Forms.ThreadCon text.RunMessage LoopInner(Int32 reason,
ApplicationCont ext context)
at System.Windows. Forms.ThreadCon text.RunMessage Loop(Int32 reason,
ApplicationCont ext context)
at System.Windows. Forms.Applicati on.Run(Form mainForm)
there is no line number of my code in the stacktrace, so i don't know where
to look. can anyone help me?
thx for any help
netracer
i have a form with a tabcontrol with 4 pages. on the first page are many
controls bound to a database. now i bound the controls of page two (two
multiline textboxes, four SelectedValues) to the db. the program compiles
without an error and runs fine, until i click on tabpage 2. then the program
throws the following exception:
System.Argument Exception: Der Objekttyp kann nicht zum Zieltyp konvertiert
werden. (english: Object type cannot be converted to target type)
at System.Windows. Forms.Control.S etVisibleCore(B oolean value)
at System.Windows. Forms.Control.s et_Visible(Bool ean value)
at System.Windows. Forms.TabPage.s et_Visible(Bool ean value)
at System.Windows. Forms.TabContro l.UpdateTabSele ction(Boolean uiselected)
at System.Windows. Forms.TabContro l.OnSelectedInd exChanged(Event Args e)
at System.Windows. Forms.TabContro l.WmSelChange(M essage& m)
at System.Windows. Forms.TabContro l.WndProc(Messa ge& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows. Forms.UnsafeNat iveMethods.Send Message(HandleR ef hWnd,
Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows. Forms.Control.S endMessage(Int3 2 msg, IntPtr wparam,
IntPtr lparam)
at System.Windows. Forms.Control.R eflectMessageIn ternal(IntPtr hWnd,
Message& m)
at System.Windows. Forms.Control.W mNotify(Message & m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows. Forms.UnsafeNat iveMethods.Call WindowProc(IntP tr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows. Forms.NativeWin dow.DefWndProc( Message& m)
at System.Windows. Forms.Control.D efWndProc(Messa ge& m)
at System.Windows. Forms.Control.W mMouseDown(Mess age& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.TabContro l.WndProc(Messa ge& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G& msg)
at
System.Windows. Forms.Component Manager.System. Windows.Forms.U nsafeNativeMeth ods+IMsoCompone ntManager.FPush MessageLoop(Int 32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows. Forms.ThreadCon text.RunMessage LoopInner(Int32 reason,
ApplicationCont ext context)
at System.Windows. Forms.ThreadCon text.RunMessage Loop(Int32 reason,
ApplicationCont ext context)
at System.Windows. Forms.Applicati on.Run(Form mainForm)
there is no line number of my code in the stacktrace, so i don't know where
to look. can anyone help me?
thx for any help
netracer
Comment