user control not working(vb .net)

Started by
1 comment, last by isiahil 19 years, 6 months ago
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?
I don't have to do nothing but live and die, everything else i choose to do- I don't know, but my dad says it alot
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.
-Vendal Thornheart=) Programming for a better tomorrow... well,for a better simulated tomorrow. ;)
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]
I don't have to do nothing but live and die, everything else i choose to do- I don't know, but my dad says it alot

This topic is closed to new replies.

Advertisement