Drawing error,Help!Help!Help!

G

Guest

My application have many picturebox objects,when run it ,sometimes i will

have a strange error,how to work out ,help me please!(in windows98,the error

cause frequently than in windowsxp)

System.InvalidOperationExceptionSystem.InvalidOperationException: The object

is currently in use elsewhere.
at System.Drawing.Image.get_Width()
at System.Drawing.Image.get_Size()
at System.Windows.Forms.PictureBox.GetPreferredSize()
at System.Windows.Forms.PictureBox.SetBoundsCore(Int32 x, Int32 y, Int32

width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.LayoutManager.AnchorControl(Control ctl, Rectangle

parentDisplayRectangle)
at System.Windows.Forms.LayoutManager.LayoutAnchoredControls(Control

container, LayoutEventArgs levent)
at System.Windows.Forms.LayoutManager.OnLayout(Control container,

LayoutEventArgs levent)
at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)
at System.Windows.Forms.Control.PerformLayout(Control affectedControl,

String affectedProperty)
at System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width,

Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Control.set_Location(Point value)
at BanZiPao.BanZiPao_Client.MDPlayTurnHandle(String Message)

the code is:
pb_CardEast0.Image=il_Card1.Images[54];
pb_CardEast1.Image=il_Card1.Images[54];
pb_CardEast2.Image=il_Card1.Images[54];
pb_CardEast3.Image=il_Card1.Images[54];
pb_CardEast4.Image=il_Card1.Images[54];
pb_CardEast5.Image=il_Card1.Images[54];
pb_CardEast6.Image=il_Card1.Images[54];
pb_CardEast7.Image=il_Card1.Images[54];
pb_CardEast8.Image=il_Card1.Images[54];
pb_CardEast9.Image=il_Card1.Images[54];
pb_CardEast10.Image=il_Card1.Images[54];
pb_CardEast11.Image=il_Card1.Images[54];
pb_CardEast12.Image=il_Card1.Images[54];

my email:[email protected]
thanks!!
 
G

Guest

My application have many picturebox objects,when run it ,sometimes i will

have a strange error,how to work out ,help me please!(in windows98,the error

cause frequently than in windowsxp

System.InvalidOperationExceptionSystem.InvalidOperationException: The object

is currently in use elsewhere
at System.Drawing.Image.get_Width(
at System.Drawing.Image.get_Size(
at System.Windows.Forms.PictureBox.GetPreferredSize(
at System.Windows.Forms.PictureBox.SetBoundsCore(Int32 x, Int32 y, Int32

width, Int32 height, BoundsSpecified specified
at System.Windows.Forms.LayoutManager.AnchorControl(Control ctl, Rectangle

parentDisplayRectangle
at System.Windows.Forms.LayoutManager.LayoutAnchoredControls(Control

container, LayoutEventArgs levent
at System.Windows.Forms.LayoutManager.OnLayout(Control container,

LayoutEventArgs levent
at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent
at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent
at System.Windows.Forms.Control.PerformLayout(Control affectedControl,

String affectedProperty
at System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width,

Int32 height, BoundsSpecified specified
at System.Windows.Forms.Control.set_Location(Point value
at BanZiPao.BanZiPao_Client.MDPlayTurnHandle(String Message

the code is
pb_CardEast0.Image=il_Card1.Images[54]
pb_CardEast1.Image=il_Card1.Images[54]
pb_CardEast2.Image=il_Card1.Images[54]
pb_CardEast3.Image=il_Card1.Images[54]
pb_CardEast4.Image=il_Card1.Images[54]
pb_CardEast5.Image=il_Card1.Images[54]
pb_CardEast6.Image=il_Card1.Images[54]
pb_CardEast7.Image=il_Card1.Images[54]
pb_CardEast8.Image=il_Card1.Images[54]
pb_CardEast9.Image=il_Card1.Images[54]
pb_CardEast10.Image=il_Card1.Images[54]
pb_CardEast11.Image=il_Card1.Images[54]
pb_CardEast12.Image=il_Card1.Images[54]

my email:[email protected]
thanks!
 

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

Similar Threads


Top