Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2004, 03:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default listing controls of form

Hi there:
I wanna list my Contols in a form of Windows based App.
Imagine I have 2 textBoxes, 2 comboBoxes & 1 ListBox!
& wanna show their name by a foreach like:
  • textBox1
  • textBox2
  • comboBox1
  • comboBox2
  • ListBox1

Can any1 help me?!

Always:),
Hovik Melkomian.
__________________
Always,
Hovik Melkomian.
 
Old April 22nd, 2004, 06:00 AM
Authorized User
 
Join Date: Apr 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

foreach(Control ctrl in this.gbClient.Controls)
{
      if(ctrl.GetType().ToString() == "System.Windows.Forms.TextBox")
    ctrl.Enabled = true;
}

This should solve your problem. The gbClient is a groupbox control.

jan

dude_in_africa





Similar Threads
Thread Thread Starter Forum Replies Last Post
Listing 8-10 and Listing 8-16. Asp.Net BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 February 6th, 2008 01:11 PM
autocenter controls on form kritimehrotra Access 1 July 31st, 2006 12:24 AM
autocenter controls on form kritimehrotra Access VBA 0 July 28th, 2006 05:56 PM
Controls on another form bjackman Access VBA 2 March 25th, 2004 01:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.