Hi

I am using vb.net.

Please see the below code.


Public Class Form1

Dim beginX_P, beginY_P, beginX_P2, beginY_P2 As Integer

Dim draggingP, draggingP2 As Boolean

Private Sub Panel1_MouseUp(ByVal sender As System.Object, ByVal e
AsSystem.Windows.Forms.MouseEventArgs)
Handles Panel1.MouseUp

draggingP = False

End Sub

Private Sub Panel1_MouseMove(ByVal sender As System.Object, ByVal e
AsSystem.Windows.Forms.MouseEventArgs)
Handles Panel1.MouseMove

If draggingP = True Then

Panel1.Location = New Point(Panel1.Location.X + e.X - beginX_P,
Panel1.Location.Y + e.Y - beginY_P)

Me.Refresh()

End If

End Sub

Private Sub Panel1_MouseDown(ByVal sender As System.Object, ByVal e
AsSystem.Windows.Forms.MouseEventArgs)
Handles Panel1.MouseDown

beginX_P = e.X

beginY_P = e.Y

draggingP = True

End Sub

Private Sub Panel2_MouseUp(ByVal sender As System.Object, ByVal e
AsSystem.Windows.Forms.MouseEventArgs)
Handles Panel2.MouseUp

draggingP2 = False

End Sub

Private Sub Panel2_MouseMove(ByVal sender As System.Object, ByVal e
AsSystem.Windows.Forms.MouseEventArgs)
Handles Panel2.MouseMove

If draggingP2 = True Then

Panel2.Location = New Point(Panel2.Location.X + e.X - beginX_P2,
Panel2.Location.Y + e.Y - beginY_P2)

Me.Refresh()

End If

End Sub

Private Sub Panel2_MouseDown(ByVal sender As System.Object, ByVal e
AsSystem.Windows.Forms.MouseEventArgs)
Handles Panel2.MouseDown

beginX_P2 = e.X

beginY_P2 = e.Y

draggingP2 = True

End Sub

End Class
Regards,
shra

On Thu, Mar 19, 2009 at 1:25 PM, CallMeLaNN <[email protected]> wrote:

>
> What is the method you already used?
> It seems that you use JavaScript to do it manually.
>
> Have you use web part?
>
>
> http://www.google.com.my/search?q=web+part&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
>
> This is some tutorial:
>
> http://en.csharp-online.net/Web_parts_for_portals%E2%80%94How_move_web_parts_between_zones
>
> Combining with AJAX.NET <http://ajax.net/> would be useful:
>
> http://waitink.blogspot.com/2008/06/ajax-web-parts-part-1-drag-and-drop.html
>
> On Mar 18, 9:35 pm, Shraddha rashinkar <[email protected]>
> wrote:
>  > Hi,
> >
> > I want to move panels like igoogle site on windows form in vb.net.
> >
> > I can make them moveable but the problem is when I move panel1 on panel2,
> it
> > overlaps the panel2 .
> >
> > Instead, I want the panel2 to move downwards and arrange it in order.
> Please
> > check igoogle site, where we can move panels easily as required.
> >
> > Thank u
> > Shra
>

Reply via email to