dcsimg
Results 1 to 5 of 5

Thread: Add-Ins for Selected Controls on IDE designer forms

  1. #1

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,627

    Add-Ins for Selected Controls on IDE designer forms

    (Note: A designer form is just an IDE form, property page, or UC while in design (not run) mode.)

    This Add-In is basically just for Windows 10 users, and also those VB6 programmers who use the IDE in SDI mode. Sorry, but I seem to be getting further and further away from an MDI version. Using the GWL_HWNDPARENT flag is the only way I've found to get things to work correctly, and this requires that the designer windows be top-level.

    This is just for Windows 10 because this rectangle isn't gone for earlier versions of Windows. Also, I use some fairly recent API calls, so it's really not recommended for anything but Windows 10.

    This entry now has two separate Add-Ins: DesignerRectangle & SelectedControls. Either can be used, or they can be used together.

    Notice: For those who grabbed the DesignerRectangle early on, please be sure to grab an updated copy and re-compile, as I needed to make some changes to it to make sure it worked well with the SelectedControls Add-In.

    Basically, the DesignerRectangle draws a red "selection" rectangle while dragging-with-left-mouse-down over a designer form. The SelectedControls shows you which controls you have selected when more than one is selected. It also shows you the controlling control for when you use the IDE's control formatting features.

    The SelectedControls also works fine when the selected controls are in a container (or nested container).

    To use these Add-Ins, compile them to some folder of your choosing. I have a folder named "C:\Program Files (x86)\Microsoft Visual Studio\VB6_Addins", but you can put it wherever you like. The act of compiling it will also register it, so don't move it once it's compiled. If you want to move it, it'd be better to just re-compile it where you want it, and delete the old copy. In case you do need to move one of these Add-In DLLs, I've also included DllReg and DllUnreg scripts written by Dilettante.

    For illustration, I think a video will serve best:



    Ok, let me outline the weaknesses:

    • It doesn't work in MDI mode. Sorry guys. You're welcome to try and fork it and make an MDI version (but I don't think it'll be easy).
    • If you find a way to move a designer around with the keyboard (not using mouse), the little squares won't follow. It's not even easy to move this way, and I'm not going to try and make that work.
    • If you use a container (or even a designer form) with a custom ScaleMode, things won't work. Again, at present, I don't see a way around this, so I have no current plans to try and make that work. You can mix-and-match ScaleModes from the designer form to nested containers, so long as all of them are standard ScaleModes (vbPixels, vbTwips, etc.).

    And the positives:

    • We get our selection rectangle and selected control indicators back (if in SDI mode), yayyy!
    • It shows the controlling control. Did older Windows versions do that? I don't think they did.
    • It's all fairly light-weight, with each Add-In using only one form. The little selection indicator squares are just light-weight shapes.

    Please let me know if you have any problems (within my specified limitations).

    Enjoy,
    Elroy

    Note: I sometimes have trouble compiling Add-Ins. I don't know if it's the registration process or what it is. Basically, here's what I do. I open it, making sure all code and designer windows are closed. Close the IDE, and re-open it, with all those code and designer windows closed ... and then compile the DLL. When done that way, it seems to compile smoothly. You just can't seem to save and also compile at the same time. However, once you get a successful compile, the Add-In seems to be fine (other than possibly things not related to the compile).
    Attached Files Attached Files
    Last edited by Elroy; Apr 30th, 2019 at 08:54 AM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  2. #2

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,627

    Re: Add-In to draw rectangle on IDE designer forms

    And a part-three, DragMoveControls. This third part is just a pair of large cross-hairs to assist with moving controls. When I'm sometimes moving a control (or group of controls), I just want to move them up a tick. But I'll also mistakenly move them left (or right) a tick as well. This Add-In should help prevent those mistakes.

    I think a video will illustrate the best. All three Add-Ins are turned on, but I'm just focusing on the blue cross-hairs.



    Also notice that it snaps to the grid. If you look in the DragMoveControlsSupport.BAS module, you'll find DragFormSize and DragSnapSize constants. You can tweak on these to change the crosshair sizes and/or snap/grid sizes.

    As with the first two Add-Ins, this one can be used alone or in any combination with the first two. And again, sorry, but this won't work with the IDE in MDI mode.

    Enjoy,
    Elroy
    Attached Files Attached Files
    Last edited by Elroy; Apr 30th, 2019 at 09:15 AM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  3. #3
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    291

    Re: Add-In to draw rectangle on IDE designer forms

    I tried in SDI and it works.
    But as mainly almost all people are using VB6 in MDI, it will be very usefull in MID

  4. #4

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,627

    Re: Add-In for Selected Controls on IDE designer forms

    Ok, update released.
    Last edited by Elroy; Apr 30th, 2019 at 08:54 AM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  5. #5

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,627

    Re: Add-Ins for Selected Controls on IDE designer forms

    Third (and last) Add-In completed (see Post #2).
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width