
Please please please, help me :-)
Firstly, I am assuming that you are trying to replicate the Forms Designer
in functionality. This being the case, here goes ...
To add controls from a toolbox to the form, you must implement drag and
drop. Serialise the selected control from the toolbox into a DataObject, and
deserialise upon the drop into a control object.
To move the button, detect whether the mouse button is held down during a
mousemove event on the new control and reset the rectangle points to reflect
the movement of the mouse.
To resize the button, detect if the mouse is at the edge of the control and
if so, expand/reduce the rectangle size in each direction according to mouse
movements instead of moving the rectangle.
Hope ths helps.
Quote:
> Hi,
> I have a VERY improtant question here and any help is VERY much
> appreciated...
> You all know how to design a form in the form designer right? :-)
> Now what I need is to program a form (and a toolbox no problems with that)
> where you can add buttons, images, texts etc... using the mouse...in
VB.NET
> - Do when clicking on a button, dragging the mouse on the form, and a
button
> is created there. (This still works out ok)
> - You must also be able to move the button (so it can not be clicked like
> buttons always do in runtime :-) ). (This is much harder)
> - And resize the button. (To do this, I have No ID...)
> Can anyone help me with some IDs... Code snipsets maybee,
> Help is Galdely appreciated...
> Kevin Chabot...