Here I am presenting a sample that I found floating on internet.
This Code allows one to implement a VB IDE like behavior that allows a user to move and resize controls at runtime!
Imagine the possibilities! There are many. For example you will be able to allow your users to arrange the content of any form in your software according to their requirement!
Of course you will have to code the part of saving the location of controls.
Anyways please check this out and enjoy it as much as I have enjoyed it and used it.
Here I am presenting a sample that I found floating on internet.
This Code allows one to implement a VB IDE like behavior that allows a user to move and resize controls at runtime!
Imagine the possibilities! There are many. For example you will be able to allow your users to arrange the content of any form in your software according to their requirement!
Of course you will have to code the part of saving the location of controls.
Anyways please check this out and enjoy it as much as I have enjoyed it and used it.
Yogi Yang
Hi, I really like your code but I can't get it to work when I want to move controls inside of a UserControl. I get 438 run-time error on the ClientToScreen api. It appears to have a handle value.
You want to have for example a ListBox rotated at 30 degrees?
What does this has to do with the moving and resizing controls?
You completely lost me, but the source code is available, so you are free to make these enhancements yourself
...What does this has to do with the moving and resizing controls?
You completely lost me,...
This is good code. I like it.
If I can get my hands on a rotating tool for some toolboxes, it will perfect for some programs with this (moving and resizing) code included.
It was a bit misleading...
Some of the tools cannot be dragged or resized. Here are some of them:
RTFBox
SSCommand
Combo
Needs to be placed inside a panel or picture box. Then double click on the frame/picturebox to resize (any) toolbox/s inside to correct width and/or height (Remember: Combo height cannot be resized).
Here are some coding I added:
Code:
Private Sub Frame2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton And m_bDesignMode Then
DragBegin Frame2
End If
End Sub
Private Sub Frame2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If m_bDesignMode Then
MCoM.Width = Frame2.Width - 240
End If
End Sub
...and it looks like this:
========
For the RTF:
Code:
Private Sub SSFra_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton And m_bDesignMode Then
DragBegin SSFra
End If
End Sub
Private Sub SSFra_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If m_bDesignMode Then
RTX.Width = SSFra.Width - 120
RTX.Height = SSFra.Height - 300
End If
End Sub
...and:
[Edited to add:]
Program working:
Last edited by Inside; Aug 10th, 2017 at 02:25 AM.