Solved

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

Posted on 2013-05-29
4
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

631 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