Jump to content
  • Advertisement
Sign in to follow this  
isiahil

user control not working(vb .net)

This topic is 5460 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have made a custom control that acts like a picture box, but has a bound property that is a RECT that holds the boundaries of the pic box. I am using vb .net 2003.when i do the following code: If ball.Bound.IntersectsWith(Wall1.Bound) Then[\code] it gives an error that says Cannot refer to 'Public Function IntersectsWith(rect As System.Drawing.Rectangle) As Boolean' because it is a member of the value-typed field 'Bound' of class 'Wall.Wall' which has 'System.MarshalByRefObject' as a base class. whats is going on?

Share this post


Link to post
Share on other sites
Advertisement
Could you show us a bit more of the code that's going on around it? Or perhaps, the user control code, especially pertaining to where that Rect is declared as a member, etc? It's hard to tell with just that one line.

Share this post


Link to post
Share on other sites
here is the wall(the custom control) code:


Public Class Wall
Inherits System.Windows.Forms.PictureBox

Public Bound As Rectangle



Private Sub Wall_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Validated
Bound.Width = Me.Width
Bound.Height = Me.Height

Bound.X = Me.Left
Bound.Y = Me.Top

End Sub

Private Sub Wall_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
Bound.Width = Me.Width
Bound.Height = Me.Height

Bound.X = Me.Left
Bound.Y = Me.Top
End Sub
End Class
[\code]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!