Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is the code that i use to move my control, how do i save and retrieve the current location of this control from a sql database table?
VB
If _mouseDown = True And RadioButton1.Checked = True Then
            Button1.Width = e.X
        Else
            If e.X >= Button1.Width - 3 And RadioButton1.Checked = True Then
                Button1.Cursor = Cursors.VSplit
            Else
                Button1.Cursor = Me.Cursor
            End If
        End If
        If _mouseDown = True And RadioButton1.Checked = True Then
            Button1.Height = e.Y
        Else

            If e.Y >= Button1.Height - 3 And RadioButton1.Checked = True Then
                Button1.Cursor = Cursors.HSplit
            Else
                Button1.Cursor = Me.Cursor
            End If
        End If
Posted

1 solution

Create a SQL table containing a set of Integer columns for the X and Y coordinates of each control. Then, write a stored procedure that takes the coordinates as arguments, and execute it whenever you want to save them.

Retrieving them is even easier; write a Select query that returns them into a recordset. Whenever you need to retrieve them, execute the query, and read the values from the returned row.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900