How to prevent controls of a collection being inserted in Controls property when control is pasted?

How to prevent controls of a collection being inserted in Controls property when control is pasted?

Post by Eberhard Beilhar » Wed, 01 May 2002 05:11:42

I have a control with a collection of buttons. Via the CollectionEditor I
can insert buttons at design time. If I copy and paste the control, VS
creates a copy of the control and its buttons, but inserts the buttons also
in the Controls property of the form!

How can I prevent the buttons being inserted in the Controls property when
pasting the control?

Thanks for any suggestions.



1. TabPage Collection of Controls and GetType Then Control Properties

I am attempting to iterate through a collection of controls on a
TabPage.  As I iterate through them, I want to determine the type of
the control and then assign some property, i.e. radiobutton.checked =
False, TextBox.Text = "", etc.
I can get through both collections fine but once I determine the type,
do I have to cast the control to a radiobutton type to get it to
recognize the radio button properties?

fyi: TabEvents is a TabControl

Here's the code I have so far:

Dim MyTab as System.Windows.Forms.TabPage
Dim c as Control

For Each MyTab in TabEvents.TabPages
     For Each c in MyTab.Controls
        If c.GetType Is GetType(System.Windows.Forms.RadioButton) Then
           ????? How do I get my control to recognize the checked
                      property for a RadioButton  ????

2. Counting the undeleted messages in an IMAP mailbox

3. Referring to Controls' properties in Controls Collection

4. Update Win 98

5. Compound Control as Parent Control / ParentControlDesigner / Controls Collection

6. How To Disable File Caching Over The Network?

7. How to prevent properties on existing controls from being displayed in the Property Browser

8. Help! Dr. Watson in Remote.exe

9. Designer: Copy/Paste Customized Control with Child- Component Collection

10. Explorer Control in WinForms I am also looking for similar code

11. I am writing my own Grid control and need help with scrolling

12. I am trying to use the Wizad server control for the first time....

13. Can't Bind ASP Control -- Am I Just Stupid?