Solved

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

Posted on 2013-05-29
4
179 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 45

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Retain selection in datagridview 2 22
Object Oriented Best Practice 5 33
VB.net PaintEventArgs Handling. 10 27
Get String split 5 32
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now