Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Is there a simple method to search for a specific control (by its name) in a form without loops? I need to access a Target control on the form to manipulate its properties, and since its name is a variable I need to find it and grab it. The result should be something like this:

 

Control cCtrl = this.GetControl("controlaName");

Edited by EFileTahi-A
Posted

No! I won't tell you! It's mine! I found it first!

 

Control[] arrCtrls = this.Controls.Find("controlName", true);

 

The boolean value indicates wether should the search include child containers too. :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...