Print Page | Close Window

.NET & FindControl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=3004
Printed Date: 05 October 2024 at 10:14pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: .NET & FindControl
Posted By: SBK2K
Subject: .NET & FindControl
Date Posted: 04 October 2005 at 9:22pm

Hi,

I'm currently evaluating the Xtreme Suite to determine if I want to start using it in my programs.

I've hit a problem I can't work out with .NET. I'm using C# and I want to disable one of the tools in the toolbar and in a menu.

I've tried using CommandBars.FindControl([toolid]).Enabled = false;

And that just disables the first tool... using the other prototype for FindControl

Public Function FindControl( _
   Optional ByVal Type As Variant, _
   ByVal
Id As Long, _
   Optional ByVal
Visible As Variant, _
   Optional ByVal
Recursive As Variant)

As follows:

CommandBars.FindControl(null, [toolid], null, true);

Still disables the tool, but only the first tool (i.e. it doesn't recurse). What am I doing wrong?




Replies:
Posted By: Oleg
Date Posted: 05 October 2005 at 12:05am

recurse mean that it try to search it in all toolbars and menus., but can return only one control.

Please use Update event to Enable/Disable controls.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net