C# Drag and Drop like uBot?

TheeAriGrande

Regular Member
Joined
Jul 14, 2013
Messages
270
Reaction score
154
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:
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:
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).

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:
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
 
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

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.
 
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.
 
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.

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
 
  • Like
Reactions: X
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.
 
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
 
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,
 
Did you ever find a solution to this OP?

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.
 
I have done Winform designer for bots. I can show you how it's done. add me on skype if you are interested...
 
Back
Top