Results 1 to 5 of 5

Thread: Drag & Drop procedure for Controls

  1. #1

    Thread Starter
    Addicted Member jeroenh's Avatar
    Join Date
    Aug 2000
    Location
    Rotterdam, Holland
    Posts
    201

    Unhappy

    I'm currently building a usercontrol with a lot of little checkboxes.

    By clicking on them you create a seqence of ones and zeros. These are stored in a database.

    The problem is that someone else has to put some of these one-zero seqences in an other database. I would like to do this by showing to controls where the one-zero seqence is copied from one usercontrol to the other.

    My problem is where do I store the temporarly data and how do I know above with other control the user drops the data. Do I use the form for this? Or is everything done from within the control?

    Please help me, I need it badly.
    Catch you later,

    Jeroen Hoekemeijer
    Code:
    If 1 = 2 Then MajorError

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    To populate the check boxes, I would use a single numeric value with a bit mask. Then you do not have to store a temporary value at all. You can just update or read from the database when necessary.

    i.e. four checkboxes

    To set up the values

    Me.CheckBox1.Checked = 1 And MyValue
    Me.CheckBox2.Checked = 2 And MyValue
    Me.CheckBox3.Checked = 4 And MyValue
    Me.CheckBox4.Checked = 8 And MyValue


    To update the value

    MyValue = 0 Or Me.CheckBox1.Checked
    MyValue = MyValue Or Me.CheckBox2.Checked
    MyValue = MyValue Or Me.CheckBox3.Checked
    MyValue = MyValue Or Me.CheckBox4.Checked

    I am not sure where the drag drop comes in. Perhaps you can elaborate....

    Cheers,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  3. #3

    Thread Starter
    Addicted Member jeroenh's Avatar
    Join Date
    Aug 2000
    Location
    Rotterdam, Holland
    Posts
    201
    Sorry I forgot to tell you all that there are 3 different targets possible.

    I use the main one with the info given by users to the system. Then the info is checked by a user and then it goes into the long term system.

    Problem is that this system works per department. There are 3 deparments in the system and so I display 3 controls wich can hold the data. Then you have the fourth, with the info given by the user. Each control consists out of 12 checkboxes and one textbox.

    Userinfo is only submitted to one of the 3 deparments. I never know wich one and the textbox input is not supposed to be copied.

    Using the answer that was shown above I can only do this to one of these 3 departments. That's why I want to redefine the drag & drop method. This way there will be no problem if the number of departements changes.

    Still need the help.
    Catch you later,

    Jeroen Hoekemeijer
    Code:
    If 1 = 2 Then MajorError

  4. #4
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Jeroen,

    Perhaps in your user control, you could use a frame and inherit its drag/drop method - you could make the frame invisible and give the user a drag handle graphic or a button to prompt them to drag - or a dialog box to indicate which control they are aiming at...

    Whatever, you could use the Class . operator to get at the values selected and use the code I showed with a class name to update the correct control.

    Alternatively, how about a drop-down combo for the target department? Associate the department name with a specific instance of your user control at start up and populate the combo accordingly?

    Cheers,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  5. #5

    Thread Starter
    Addicted Member jeroenh's Avatar
    Join Date
    Aug 2000
    Location
    Rotterdam, Holland
    Posts
    201
    Well I must say you inspired my with the combobox thingy.

    I think it will work. I can then create 2 controls where one of them changes from departement. Then you have almost the same capabilitys as with the drag & drop system I had in mind.

    Thank you Paul.
    Catch you later,

    Jeroen Hoekemeijer
    Code:
    If 1 = 2 Then MajorError

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width