Click here to Skip to main content
15,919,613 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Load pdf into picturebox binding to dataset Pin
Dave Kreskowiak4-Dec-12 12:31
mveDave Kreskowiak4-Dec-12 12:31 
QuestionSaving a form and its contents as an image Pin
tuffhamster30-Nov-12 4:37
tuffhamster30-Nov-12 4:37 
AnswerRe: Saving a form and its contents as an image Pin
Eddy Vluggen30-Nov-12 23:41
professionalEddy Vluggen30-Nov-12 23:41 
GeneralRe: Saving a form and its contents as an image Pin
tuffhamster1-Dec-12 3:18
tuffhamster1-Dec-12 3:18 
GeneralRe: Saving a form and its contents as an image Pin
Eddy Vluggen1-Dec-12 4:04
professionalEddy Vluggen1-Dec-12 4:04 
QuestionActivex can't create object error in VB6.0 Pin
Pradeep Londhe29-Nov-12 22:49
Pradeep Londhe29-Nov-12 22:49 
AnswerRe: Activex can't create object error in VB6.0 Pin
Deepak Shitole14-Dec-12 21:25
Deepak Shitole14-Dec-12 21:25 
QuestionActivex can't create object error in VB6.0 Pin
Pradeep Londhe29-Nov-12 22:49
Pradeep Londhe29-Nov-12 22:49 
AnswerRe: Activex can't create object error in VB6.0 Pin
Simon_Whale29-Nov-12 22:53
Simon_Whale29-Nov-12 22:53 
Questionhow to give Chinese characters sa in put in a Text box in vb.net Pin
ramesh.mandapelly29-Nov-12 22:03
ramesh.mandapelly29-Nov-12 22:03 
AnswerRe: how to give Chinese characters sa in put in a Text box in vb.net Pin
Bernhard Hiller29-Nov-12 22:11
Bernhard Hiller29-Nov-12 22:11 
QuestionHow to use c++ class into vba? Pin
gui.cmsilva29-Nov-12 17:16
gui.cmsilva29-Nov-12 17:16 
QuestionHow Bind Multiple Columns under Same Label and store in database(VB 2010) Pin
charuwaka29-Nov-12 5:06
charuwaka29-Nov-12 5:06 
QuestionHow to make Login Page For a Windows Application Form(VB 2010) Pin
charuwaka29-Nov-12 3:41
charuwaka29-Nov-12 3:41 
AnswerRe: How to make Login Page For a Windows Application Form(VB 2010) Pin
Zaf Khan1-Dec-12 8:09
Zaf Khan1-Dec-12 8:09 
QuestionVB.NET / APPLICATION SETTINGS Pin
mebjen29-Nov-12 2:17
mebjen29-Nov-12 2:17 
AnswerRe: VB.NET / APPLICATION SETTINGS Pin
Dave Kreskowiak29-Nov-12 3:55
mveDave Kreskowiak29-Nov-12 3:55 
GeneralRe: VB.NET / APPLICATION SETTINGS Pin
mebjen29-Nov-12 4:29
mebjen29-Nov-12 4:29 
GeneralRe: VB.NET / APPLICATION SETTINGS Pin
Dave Kreskowiak29-Nov-12 10:36
mveDave Kreskowiak29-Nov-12 10:36 
GeneralRe: VB.NET / APPLICATION SETTINGS Pin
mebjen29-Nov-12 10:57
mebjen29-Nov-12 10:57 
GeneralRe: VB.NET / APPLICATION SETTINGS Pin
Dave Kreskowiak29-Nov-12 15:50
mveDave Kreskowiak29-Nov-12 15:50 
QuestionMouse Down Event and Flag setting Pin
big_col28-Nov-12 19:53
big_col28-Nov-12 19:53 
Hi
I have a strange problem which i am not sure if it is an issue in VB

VB
Public Class Form1

    Private moving As Boolean = False

    Private Sub Label2_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label2.MouseDown
        ' if the left button has been pressed

        If e.Button = Windows.Forms.MouseButtons.Left Then
            ' Set the flag to show mouse down

            moving = True

        End If

    End Sub

    Private Sub Label2_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label2.MouseUp
        ' The button was released, reset flag.
        moving = False

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label3.Text = moving
    End Sub

    Private Sub Form1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove

        Dim eLocation As New System.Drawing.Point(e.X, e.Y)

        If moving = True Then


            Label1.Text = "X." & e.X & vbCrLf & "Y." & e.Y
            Label2.Location = eLocation
        End If
    End Sub
End Class


There is a label on the form and when you click on it is should be dragable on the form. The issue is that the flag is not been set on the mouse down event but I am not sure why or if it is the mouse move event where I test for the flag is always false. If I take the test for the flag out of the mouse move the label follows the mouse with the left mouse button down so all events seem to be working. If I declare the flag as true at start up the label also follows the mouse until the left button is pressed and released resetting the flag. I have also tried removing the flag reset in mouse up event, this actually starts to work when the left button is released.

Any help would be appreciated
Col
VB Express 2010
AnswerRe: Mouse Down Event and Flag setting Pin
Simon_Whale28-Nov-12 22:46
Simon_Whale28-Nov-12 22:46 
GeneralRe: Mouse Down Event and Flag setting Pin
big_col29-Nov-12 2:09
big_col29-Nov-12 2:09 
GeneralRe: Mouse Down Event and Flag setting Pin
Simon_Whale29-Nov-12 3:06
Simon_Whale29-Nov-12 3:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.