Solved

Help with Panel.Controls.Contains?

Posted on 2002-07-25
4
475 Views
Last Modified: 2008-03-04
How can I deturmine of a Panel contains a form?
0
Comment
Question by:eeevbeee
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 60 total points
ID: 7178163
You can always traverse any control to check for presence of any kind of control.....


if (null != GetFormCtl(panelCtl))
{
 /* Has Form */
}

private Form GetFormCtl(Control parentCtl)
{
 if (prentCtl is Form)
 {
    return (Form)parentCtl;
 }
 Control ctl = null;
 int nCount = parentCtl.Controls.Count;
 for (int i = 0; i < nCount; i++)
 {
   ctl = GetFormCtl(parentCtl.Controls[i];
   if(ctl is Form)
   {  
     break;
   }
 }
 return (Form)ctl;
}
0
 

Author Comment

by:eeevbeee
ID: 7178468
This looks very good, only I can't make out much since I don't speak C# or C++ only VB. Anyway you can do this in VB??


thanks

0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7179724
I am not a VB person.. but i will give it a shot :-)
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9421019
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by naveenkohli

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

747 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

10 Experts available now in Live!

Get 1:1 Help Now