Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Which all controls in vb.net associate themselves with the container in designer file?

Posted on 2013-05-29
4
Medium Priority
?
198 Views
Last Modified: 2013-07-03
Which all controls in vb.net associate themselves with the container in designer file?

For example ContextMenuStrip and ToolTip associate themselves with the container as in the code written below but MenuStrip doesn't .why?

The following line in the below code:
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
====================================================================
 'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
        Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem
        Me.A1ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem

Open in new window




Thanks in advance
0
Comment
Question by:hc_gupta
4 Comments
 

Author Comment

by:hc_gupta
ID: 39206764
I'm sorry but I didn't get your answer.I wanna know as contextMenuStrip get initialized as below code in designer file

Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)


Similarly , which all controls  associate themselves with the containers and get initialized using (Me.components)
0
 
LVL 46

Expert Comment

by:aikimark
ID: 39207456
@hc_gupta

My comment was administrative in nature and not meant to be a solution to your problem.

aikimark -- zone advisor
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1000 total points
ID: 39249927
The simplest answer is that any control which is not added to Controls collection of a form uses the container to ensure that it gets dispose properly when form closes. There is no list of such controls as far as I know
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question