TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sachin yadav
NA
9
17.8k
Find Iteratively Child Controls contained by other parent controls
Jun 22 2011 1:36 AM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Control_practice1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
FindControls(this, comboBox2);
}
public void FindControls(Control control, Control FillerControl)
{
ComboBox cb = (ComboBox)FillerControl;
for (int i = 0; i < control.Controls.Count; i++)
{
cb.Items.Add(control.Controls[i].Name);
}
}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
comboBox3.Items.Clear();
Control cc = new Control();
cc = Controls[comboBox2.Text];
FindControls(cc, comboBox3);
}
}
}
Reply
Answers (
1
)
How to find child controls of another control(parent control)
PDF Creator desktop application help reqired