Jump to content
Sign in to follow this  

draggable shapes

Recommended Posts


I see that its possible to drag images and listview items. But is it possible to create a simple shapes like squares, rectangles and circles and make them dragable within a gui? (trying to avoid the clutter of image files)

then i can save the coordinates of each item and refer to them later

i am trying to create a workspace designer which can be saved then later refered to

thanks =)

Share this post

Link to post
Share on other sites

Might be an idea to refer to the inner workings of CyberSlug's GUIBuilder. It may be old, but it most likely what you're after.

TheSaint has an updated version that can be found here:




Share this post

Link to post
Share on other sites

I did similar project in my work in other programming language but principles are the same no matter of programming language and it uses mainly Win32 API calls anyway.

In my project I draw on label control rectangles (and other stuff like axis etc) representing orders from database, it has different colors based on state of order and many other information drew on it.

The princip of dragging is that I can calculate order number from mouse coordinates because it has rectangle shape and in case of mouse_down event I do painting of that order around mouse pointer until mouse is released.

I use inner bitmap with all orders painted on it and in wm_paint event I do BitBlt from inner bitmap (DC) to label (its DC).

In fact I do also horizontal/vertical scrolling myself so I use more helper inner bitmaps and ScrollDC API calls on them according H/V scrollbar position. See attached screenshot.


Edited by Zedna

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.