Click here to Skip to main content
15,920,383 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: VB.net connect database MySQL online Pin
manoph31-Jul-13 23:36
manoph31-Jul-13 23:36 
GeneralRe: VB.net connect database MySQL online Pin
Eddy Vluggen1-Aug-13 9:03
professionalEddy Vluggen1-Aug-13 9:03 
QuestionReport with Crystal Report Pin
Biplob Singha Shee28-Jul-13 21:42
Biplob Singha Shee28-Jul-13 21:42 
SuggestionRe: Report with Crystal Report Pin
ZurdoDev9-Aug-13 8:01
professionalZurdoDev9-Aug-13 8:01 
QuestionDo I need to implement Dispose() ? Pin
David Mujica26-Jul-13 5:31
David Mujica26-Jul-13 5:31 
AnswerRe: Do I need to implement Dispose() ? Pin
Richard Deeming26-Jul-13 5:41
mveRichard Deeming26-Jul-13 5:41 
GeneralRefactoring my code now Pin
David Mujica26-Jul-13 8:03
David Mujica26-Jul-13 8:03 
QuestionCreate Dynamic Label with Drag and Drop Function Pin
Val Gerald Dela Cruz24-Jul-13 14:53
Val Gerald Dela Cruz24-Jul-13 14:53 
Hello All,



I want to make a Label that I can drag and drop. At the same time when I drag the original label it will leave a copy of it self.



Example: When I drag Label1 it will leave another Label to its Original Position( Lets Name the New Label1 in Original Position as Label2),

Then I should also be able to drag Label2 and Leave another Label (Label3), I also want to drag Label1 and Label2 but it should not leave a copy.



Here is my code: I been able to do multiplication of Label and Dragging of Label but I cannot drag all Labels:

VB
Public Class Form1
    Dim cursorX, cursorY As Integer
    Dim dragging As Boolean
    Dim labelno As Integer = 1

    Private Sub Control_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown
        dragging = True
        cursorX = e.X
        cursorY = e.Y


        Dim label2 As New Label
        labelno += 1
        label2.Location = New Point(Label1.Location.X, Label1.Location.Y)
        label2.Name = "Label" + labelno.ToString
        label2.Text = label2.Location.ToString
        Me.Controls.Add(label2)

    End Sub

    Private Sub Control_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseUp
        dragging = False
    End Sub

    Private Sub control_MouseMOve(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseMove
        If dragging Then
            Dim ctrl As Control = CType(sender, Control)
            ctrl.Left = (ctrl.Left + e.X) - cursorX
            ctrl.Top = (ctrl.Top + e.Y) - cursorY
            ctrl.BringToFront()
        End If
    End Sub


VB
If you have clarification please inform me.



Thanks

AnswerRe: Create Dynamic Label with Drag and Drop Function Pin
Dave Kreskowiak24-Jul-13 17:07
mveDave Kreskowiak24-Jul-13 17:07 
QuestionThree column autocomplete Combobox in form and datagridview Pin
Biplob Singha Shee23-Jul-13 19:44
Biplob Singha Shee23-Jul-13 19:44 
AnswerRe: Three column autocomplete Combobox in form and datagridview Pin
Eddy Vluggen31-Jul-13 8:59
professionalEddy Vluggen31-Jul-13 8:59 
GeneralRe: Three column autocomplete Combobox in form and datagridview Pin
Biplob Singha Shee1-Aug-13 21:34
Biplob Singha Shee1-Aug-13 21:34 
QuestionHow to pass parameter in reportviewer which is calling .RDLC report Pin
Member 381516522-Jul-13 18:43
Member 381516522-Jul-13 18:43 
AnswerRe: How to pass parameter in reportviewer which is calling .RDLC report Pin
Mycroft Holmes22-Jul-13 19:12
professionalMycroft Holmes22-Jul-13 19:12 
GeneralRe: How to pass parameter in reportviewer which is calling .RDLC report Pin
Member 381516523-Jul-13 7:01
Member 381516523-Jul-13 7:01 
AnswerRe: How to pass parameter in reportviewer which is calling .RDLC report Pin
TnTinMn23-Jul-13 7:34
TnTinMn23-Jul-13 7:34 
QuestionVB6 output Access 2000 report to pdf Pin
Member 981947022-Jul-13 9:53
Member 981947022-Jul-13 9:53 
AnswerRe: VB6 output Access 2000 report to pdf Pin
Mycroft Holmes22-Jul-13 12:48
professionalMycroft Holmes22-Jul-13 12:48 
AnswerRe: VB6 output Access 2000 report to pdf Pin
Dave Kreskowiak22-Jul-13 13:55
mveDave Kreskowiak22-Jul-13 13:55 
Questionvbaproject.bin read Pin
JR21220-Jul-13 3:35
JR21220-Jul-13 3:35 
AnswerRe: vbaproject.bin read Pin
Dave Kreskowiak20-Jul-13 7:08
mveDave Kreskowiak20-Jul-13 7:08 
AnswerRe: vbaproject.bin read Pin
TnTinMn20-Jul-13 11:52
TnTinMn20-Jul-13 11:52 
QuestionHow to find mysql table field is empty ? Pin
Biplob Singha Shee19-Jul-13 22:42
Biplob Singha Shee19-Jul-13 22:42 
AnswerRe: How to find mysql table field is empty ? Pin
Biplob Singha Shee20-Jul-13 0:32
Biplob Singha Shee20-Jul-13 0:32 
QuestionERROR When I Show Openfiledialog.ShowDialog() Pin
Sang Nguyen Minh19-Jul-13 8:44
Sang Nguyen Minh19-Jul-13 8:44 

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.