By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,686 Members | 2,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,686 IT Pros & Developers. It's quick & easy.

Accessing controls on the ComponentTray

P: n/a
It seems that controls that are in a form's ComponentTray (e.g. ToolTip,
ErrorProvider) don't appear on its list of controls (FormName.Controls). Is
there any way I can get hold of them?

Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

"Controls" in component tray are components :). Try with components variable
that is in your form class (private System.ComponentModel.IContainer
components).

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Duncan" <Du****@discussions.microsoft.com> je napisal v sporočilo
news:59**********************************@microsof t.com ...
It seems that controls that are in a form's ComponentTray (e.g. ToolTip,
ErrorProvider) don't appear on its list of controls (FormName.Controls).
Is
there any way I can get hold of them?

Jul 21 '05 #2

P: n/a
Thanks for the advice, Peter, but I'm not too sure how I should go about
this. To get the controls, I would use:

For Each c as Control in myForm.Controls

What would I use to get at these components?

Thanks,

--
Duncan

"Peter Jausovec" wrote:
Hi,

"Controls" in component tray are components :). Try with components variable
that is in your form class (private System.ComponentModel.IContainer
components).

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)

Jul 21 '05 #3

P: n/a
You can use components.Components to get ComponentCollection and you can go
through each component.

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Duncan" <Du****@discussions.microsoft.com> je napisal v sporočilo
news:A5**********************************@microsof t.com ...
Thanks for the advice, Peter, but I'm not too sure how I should go about
this. To get the controls, I would use:

For Each c as Control in myForm.Controls

What would I use to get at these components?

Thanks,

--
Duncan

"Peter Jausovec" wrote:
Hi,

"Controls" in component tray are components :). Try with components
variable
that is in your form class (private System.ComponentModel.IContainer
components).

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)

Jul 21 '05 #4

P: n/a
Thanks, Peter - that seems to do it.

I'd found another way (using reflection), but this seems simpler.

Thanks again,

--
Duncan

"Peter Jausovec" wrote:
You can use components.Components to get ComponentCollection and you can go
through each component.

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.