1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C# Drag and Drop like uBot?

Discussion in 'C, C++, C#' started by TheeAriGrande, Aug 27, 2013.

  1. TheeAriGrande

    TheeAriGrande Regular Member

    Joined:
    Jul 14, 2013
    Messages:
    270
    Likes Received:
    151
    Location:
    Candlestick Park
    Edit: I'm not trying to compete with or replicate uBot. I'm trying to create a similar drag and drop experience in my bot.

    I'm trying to give the ability to drag and drop commands from a "toolbox" in my bot. I'm using uBot Studio as the ultimate model.

    Basically, the user drags commands into a container in the order that he/she wants. Commands are basically calls to methods. Some commands will require (or have optional) settings to customize. Some commands that are dropped will depend on others, this means the existing commands in a container will need to be checked before the chosen command can be added to the container.

    The above was a mouthful. If anything above needs clarification then let me know please. I have a very vague idea in my mind but could really use some help. I need help finding some sort of example or guide. I've searched for days but haven't found anything.

    Thanks in advance.

    All the best, tAG


    EDIT: I just found a promising resource right after I posted this. It's not a full exact guide, but it pointed me into a good direction. Any extra help is greatly appreciated.
     
    Last edited: Aug 27, 2013
  2. phr0zt

    phr0zt Regular Member

    Joined:
    Jun 30, 2007
    Messages:
    439
    Likes Received:
    182
    Are you using WPF or WinForms for your GUI (for the dragging and dropping hooked up to the event handlers)?

    Hopefully you're taking the WPF route, your life will be much easier (had to learn that the hard way lol).
     
    Last edited: Aug 27, 2013
  3. TheeAriGrande

    TheeAriGrande Regular Member

    Joined:
    Jul 14, 2013
    Messages:
    270
    Likes Received:
    151
    Location:
    Candlestick Park
    Sadly, I'm using winforms for the GUI.

    Edit: I feel Winforms would be easier, in my opinion. But then again, I could be wrong.
     
    Last edited: Aug 27, 2013
  4. phr0zt

    phr0zt Regular Member

    Joined:
    Jun 30, 2007
    Messages:
    439
    Likes Received:
    182
    ah gotcha, I can't be of much help then, apologies. Even then, I've only worked on basic drag-n-drop features with WPF, so I'd only be able to point you in the right direction. Hopefully someone else will jump in give you some assistance
     
    • Thanks Thanks x 1
  5. TheeAriGrande

    TheeAriGrande Regular Member

    Joined:
    Jul 14, 2013
    Messages:
    270
    Likes Received:
    151
    Location:
    Candlestick Park
    No problem. Maybe I'll make the switch to WPF. I know it runs a MVVM and I have a background with MVC so it shouldn't be that hard.
     
  6. phr0zt

    phr0zt Regular Member

    Joined:
    Jun 30, 2007
    Messages:
    439
    Likes Received:
    182
    Yeah MVVM is a little different than MVC but making the jump from one to the other isn't painful at all, and WPF is definitely the way of the future; it wouldn't be a bad transition, the stuff you can achieve with WPF is awesome.
     
    • Thanks Thanks x 1
  7. TheeAriGrande

    TheeAriGrande Regular Member

    Joined:
    Jul 14, 2013
    Messages:
    270
    Likes Received:
    151
    Location:
    Candlestick Park
    Alright, I'm going to take the leap into WPF. I'll look at a few articles this week and if I feel comfortable then I'll jump into it this weekend.

    Thanks for the help.

    All the best, tAG
     
    • Thanks Thanks x 1
  8. sm754

    sm754 Registered Member

    Joined:
    Mar 21, 2012
    Messages:
    93
    Likes Received:
    38
    Occupation:
    Farmer
    Location:
    Azerbaijan
    I have a software package which works similarly to this; it uses WPF. Doesn't look very fancy, but it's a very powerful way to bot, since development is so rapid.
     
  9. TheeAriGrande

    TheeAriGrande Regular Member

    Joined:
    Jul 14, 2013
    Messages:
    270
    Likes Received:
    151
    Location:
    Candlestick Park
    I'm currently making the switch to WPF.

    Any help regarding WPF and a UI like uBot would be if great help!

    Posted via Topify using iPhone/iPad
     
  10. neutralhatter

    neutralhatter Jr. VIP Jr. VIP Premium Member

    Joined:
    Jun 23, 2010
    Messages:
    430
    Likes Received:
    330
    you need to work with mousedown and mouse up events. (or similar)

    dragging and dropping is in fact just an illusion.

    First try to perform a mousedown drag your mouse and release where the item supposed to appear and create your item there.

    once this works, I would advise just working on the visual bits where your Z axis will be higher then all the rest and absolute so that you will hover above all other items.

    hope this helps,
     
  11. Chris22

    Chris22 Regular Member

    Joined:
    Sep 29, 2010
    Messages:
    400
    Likes Received:
    1,059
    Did you ever find a solution to this OP?
     
  12. TheeAriGrande

    TheeAriGrande Regular Member

    Joined:
    Jul 14, 2013
    Messages:
    270
    Likes Received:
    151
    Location:
    Candlestick Park
    I just made the switch to WPF a couple weeks ago but I've had no time to code up anything. I've been doing some research and when I get time I'm going code up a solution.

    It's possible with WPF, though. So, there is a solution but I don't have it coded yet.
     
  13. botrockets

    botrockets Regular Member

    Joined:
    Mar 16, 2013
    Messages:
    272
    Likes Received:
    463
    Occupation:
    Software Developer
    Location:
    Saint T.N.
    I have done Winform designer for bots. I can show you how it's done. add me on skype if you are interested...