Theres no picture attached, but if there were it would not help.
Store the position of pegs in a class level variable.
Do ALL your drawing in the forms Paint method.
In your mouse events, update the position of the current peg and Invalidate
the form, preferably passing a rectangle to the Invalidate call so that only
the relevant part of the form gets painted.
--
Mick Doherty
http://homepage.ntlworld.com/mdaudi1...nate/home.html
"Supra" <supra5656@rogers.com> wrote in message
news:iXVyc.225147$Ar.11282@twister01.bloor.is.net. cable.rogers.com...[color=blue]
> can u see my pic? on right side i clicked peg and moved another location
> (grid), but b4 i moved peg another location. the peg isn't invisible. i
> am using gdi graphic using image. there are no control on form.
> ne ideas u can give me an hint?
> regards,
> supra
>
> One Handed Man ( OHM#) wrote:[color=green]
> > I dont really know how you have written this. But one approach might be[/color][/color]
to[color=blue][color=green]
> > repaint a sqare either with or without the peg, depending on the[/color][/color]
underlying[color=blue][color=green]
> > matrix properties ( assuming you have coded it like this. )
> >
> > Regards - OHM
> >
> >
> >
> >
> > "Supra" <supra5656@rogers.com> wrote in message
> > news:KdByc.9$A_21.8@news04.bloor.is.net.cable.roge rs.com...
> >[color=darkred]
> >>i got board working using graphic window in vb.net but no controls
> >>adding to form. i am doing checker board game. when i clicked and moved
> >>the peg to another location(grid). but how do i get bitmap or image to
> >>make invisible.
> >>
> >>here is code for mouseevent:
> >>
> >>Protected Overrides Sub OnMouseDown(ByVal e As
> >>System.Windows.Forms.MouseEventArgs)
> >> Me.PegPicking = True
> >> If Me.PegPicking = True Then
> >> g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
> >> DrawingUtility.DrawPeg(g, New Rectangle(Me.mPosition.X
> >>- 15, Me.mPosition.Y - 15, 30, 30), Me.PelleteColors(0))
> >> g.SmoothingMode = Drawing2D.SmoothingMode.HighSpeed
> >>
> >> End If
> >> ' Invalidate()
> >> End Sub
> >>
> >> Protected Overrides Sub OnMouseMove(ByVal e As
> >>System.Windows.Forms.MouseEventArgs)
> >> ' change Position to current mouse Position
> >> Me.mPosition = New Point(e.X, e.Y)
> >> ' Repaint to Show Effect
> >> Invalidate()
> >> ' End If
> >> End Sub
> >>
> >> Protected Overrides Sub OnMouseUp(ByVal e As
> >>System.Windows.Forms.MouseEventArgs)
> >> Me.PegPicking = True
> >> 'Inserting Pegs but only is Game is Active
> >> Invalidate()
> >> End Sub
> >>
> >>how do i make bitmap or image invisible or something like disappearing?
> >>[/color]
> >
> >
> >[/color]
>[/color]
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004