moving panel(or any other control) at runtime

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
4 posts Page 1 of 1
Contributors
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Hi this is just a basic tut how to move a panel or any control at run time :D
OK the project has some extra stuff, so if you want that just dl the project.
Okay now you'll need to put this under Public Class ..
So we have a panel called pnl1..
Code: Select all
Dim smth as Point'Smth is something I dont know what to call it xD, you can call it pt or something.

 Private Sub pnl1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pnl1.MouseDown
        smth = New Point(-e.X, -e.Y)
        lb1.ForeColor = Color.White
    End Sub

Private Sub pnl1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pnl1.MouseMove
        If e.Button = Windows.Forms.MouseButtons.Left Then
            Dim cp As Point = Me.PointToClient(MousePosition)
            cp.Offset(smth.X, smth.Y)
            pnl1.Location = cp
        End If
    End Sub
You'll find everything you need in this app:
You do not have the required permissions to view the files attached to this post.
Last edited by Agust1337 on Thu Dec 16, 2010 6:30 pm, edited 1 time in total.
Top-notch casual Dating
User avatar
XTechVB
VIP - Site Partner
VIP - Site Partner
Posts: 727
Joined: Thu May 20, 2010 10:32 am

i've made this a long time ago but still Nice Tut.
This program is not too complicated perhaps you should write the tutorial here
You can find me on Facebook or on Skype mihai_92b
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Yeah, write it instead of just posting a file. You get much more reputation and you get more people to read it.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Well i was in a hurry, but i will put the codes.
Top-notch casual Dating
4 posts Page 1 of 1
Return to “Tutorials”