This is a migrated thread and some comments may be shown as answers.

Is it possible to drag control from one form to another form in vb.net in visual studio 2012 using telerik controls ?

1 Answer 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aravind
Top achievements
Rank 2
Iron
Iron
Iron
Aravind asked on 20 Aug 2013, 07:52 AM
 Private blnMoving As Boolean = False
    Private MouseDownX As Integer
    Private MouseDownY As Integer
    Private MovingRect As Rectangle
    Private oldRect As Rectangle
    Private blnClick As Boolean = False
 
    Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
        If e.Button = MouseButtons.Left Then
            blnMoving = True
            MouseDownX = e.X
            MouseDownY = e.Y
            MovingRect = New Rectangle(Button1.Location, Button1.Size)
        End If
    End Sub
 
    Private Sub Button1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseUp
        If e.Button = MouseButtons.Left And Not blnClick Then
            Button1.Location = Me.PointToClient(New Point(MovingRect.X, MovingRect.Y))
            Me.Refresh()
            oldRect = oldRect.Empty
            blnMoving = False
        Else
            blnClick = False
            blnMoving = False
        End If
    End Sub
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        blnClick = True
    End Sub
 
    Private Sub Button1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseMove
        If blnMoving Then
            If Not oldRect.IsEmpty Then
                ControlPaint.DrawReversibleFrame(MovingRect, Me.BackColor, FrameStyle.Thick)
                Button1.Refresh()
            End If
 
            Dim temp As Point = Me.PointToScreen(New Point(Button1.Location.X + (e.X - MouseDownX), Button1.Location.Y + (e.Y - MouseDownY)))
 
            MovingRect.X = temp.X
            MovingRect.Y = temp.Y
 
            If Me.ClientRectangle.Contains(Me.RectangleToClient(MovingRect)) Then
                oldRect = MovingRect
            Else
                MovingRect = oldRect
            End If
            ControlPaint.DrawReversibleFrame(MovingRect, SystemColors.Control, FrameStyle.Thick)
        End If
    End Sub
but my need is form main form if i click button it open one floating form and it contains controls,and form that folating form i need to click the control and drag and drop in main form.And also capture and save the location in form ,if i close application and open again i need to fix button in last time saved x and y axis location, so where i capture the x axis and y axis ? is it possible to capture x axis and y axis in sql server ?,and if i open again is possible to retrive data from sql server and give to controls ?
Is it possible ?
 
Regards
Aravind

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 23 Aug 2013, 08:27 AM
Hi Aravind,

Thank you for writing.

I am afraid that this question is not related to any of our components in the Radcontrols for WinForms suite, hence it is out of the scope of our support services. I am certain that if you manage to achieve such functionality with the microsoft controls you will also be able to achieve it with ours. If you manage to do that and you experience any issues to accommodate the same approach to our controls, please let us know and we will gladly help you to implement it.

Do not hesitate to contact us if you have other questions.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
General Discussions
Asked by
Aravind
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dimitar
Telerik team
Share this question
or