g0tp0t
2010-05-09 17:59:57
is this written correctly?when i run, the pholder moves down 1 pixel seemingly randomly but at an average speed of like 6 pixels per 2 seconds. also, when i click the mouse(not releaseing it, basicly calling mousedown event) the pholder moves to point 0,0. i dont think i asked it to do that :\ :]
EDIT: this is supposed to allow me to drag the picture box around during runtime.
EDIT: PHolder is a PictureBox
EDIT: this is supposed to allow me to drag the picture box around during runtime.
Public Class PBox
Property Img() As String
Set(ByVal value As String)
PHolder.ImageLocation = Img
End Set
Get
Img = PHolder.ImageLocation
End Get
End Property
Private Sub PHolder_Loaded(ByVal sender As System.Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles PHolder.LoadProgressChanged
PHolder.ImageLocation = "C:\Users\josh\Pictures\cgjvbmn.png"
End Sub
Public M_Point, ploc, pmove As Point
Public Downn As Boolean = False
Public upp As Boolean = False
Private Sub Mouse_Down(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PHolder.MouseDown, MyBase.MouseDown, ToolStripComboBox1.MouseDown, ToolStripMenuItem1.MouseDown
M_Point = MousePosition
Downn = True
Dim senderer As Object = PHolder
Dim ee As System.EventArgs
ee = EventArgs.Empty
Call PBox_Move(senderer, e)
End Sub
Private Sub PBox_Move(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PHolder.MouseMove
If Downn Then PHolder.Location = New Point((PHolder.Location.X + MousePosition.X - M_Point.X) / 2, (PHolder.Location.Y + MousePosition.Y - M_Point.Y) / 2)
End Sub
Private Sub PHolder_MouseUp(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PHolder.MouseUp
Downn = False
End Sub
End ClassEDIT: PHolder is a PictureBox