Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

vb.net group shapes together?

vb.net 2008 express I have the LineShape and the OvalShape in the toolbox. I have created a gunsite and I want to refer to it by one name in the code, how can I group the components together and refer to them by a single name.

This is what I mean http://imgur.com/mdf64

Thanks

Update:

Found a workaround that will do for now, create a groupbox and put the drawing objects in that and then refer to the groupbox, I can make the gunsite the same colour as the groupbox border so it looks part of the graphic. Not sexy but this if for my students not real life :-)

Update 2:

Thanks Ratchter the panel is better but I have discovered another characteristic that applies to both the panel and the groupbox, both their backgrounds, despite being set to transparent, act as opaque and don't allow other form components to be seen. This is also true if you put a transparent png in the panel (or groupbox).

If you use a rectangle from the toolbox and set it to transparent it is truly transparent and other form components can be seen through it.

Thanks for the help anyway

2 Answers

Relevance
  • 9 years ago
    Favorite Answer

    You can use a Panel instead of a groupbox. A panel doesn't have a border by default. Put the lines and oval inside the panel, they will stay with it.

  • ?
    Lv 5
    9 years ago

    I have the same issue and have not found a solution, despite asking many people who have programming knowledge.

    In my experience, the easiest way to do this is to make a function that then runs whatever process you want on all elements of the 'group'. This limits you slightly, but may be useful depending on what you need it for. If you want to move it around, this will work fine, just call the new coordinates as part of the function and then calculate the positions of all the elements within the function.

Still have questions? Get your answers by asking now.