473,698 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Toolstrip

Hi
I have a Toolstrip on a Window with 5 buttons

i want to send this to a application static fucnction
to enable / disable the buttons based on User rights

When i send Window.controls to the method
buttons dont exists in the Controls Collection

When i work with the Toolstrip i can't see any controls
how to see the controls attatched to the Toolstrip
Thanks
DaveL
Oct 25 '08 #1
2 3012
Controls on the ToolStrip exists in the Control collection of the
ToolStrip and not the underlying form.
you can access the controls on the tool strip from it's Items property.

The buttons(& other controls) on these tool strip exist as a member of
the underlying form but are not in it's control collection.

If you are calling this static method before any instance of the class
is being created, its better to create some static fields in the same
class which will indicate which buttons to enable/disable. Now on the
form load event check these fields and enable/disable the buttons
accordingly. To enable/disable the buttons you don't have to worry about
the last two statements above.

Thanks & Regards,
Ashutosh Bhawasinka

daveL wrote:
Hi
I have a Toolstrip on a Window with 5 buttons

i want to send this to a application static fucnction
to enable / disable the buttons based on User rights

When i send Window.controls to the method
buttons dont exists in the Controls Collection

When i work with the Toolstrip i can't see any controls
how to see the controls attatched to the Toolstrip
Thanks
DaveL
Oct 26 '08 #2
Thank you much
davel
"Ashutosh Bhawasinka" <di********@ash utosh.inwrote in message
news:ek******** ******@TK2MSFTN GP05.phx.gbl...
Controls on the ToolStrip exists in the Control collection of the
ToolStrip and not the underlying form.
you can access the controls on the tool strip from it's Items property.

The buttons(& other controls) on these tool strip exist as a member of the
underlying form but are not in it's control collection.

If you are calling this static method before any instance of the class is
being created, its better to create some static fields in the same class
which will indicate which buttons to enable/disable. Now on the form load
event check these fields and enable/disable the buttons accordingly. To
enable/disable the buttons you don't have to worry about the last two
statements above.

Thanks & Regards,
Ashutosh Bhawasinka

daveL wrote:
>Hi
I have a Toolstrip on a Window with 5 buttons

i want to send this to a application static fucnction
to enable / disable the buttons based on User rights

When i send Window.controls to the method
buttons dont exists in the Controls Collection

When i work with the Toolstrip i can't see any controls
how to see the controls attatched to the Toolstrip
Thanks
DaveL

Oct 28 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1324
by: Fredrik Melin | last post by:
2005 RTM: Have a form, quite a few control, (full form of stuff, tab pages, buttons, labels, text-controls etc) Selecting controls, going in and out between code/design view is a little bit sluggy, but still doable Add a Toolstrip, add a few buttons to that toolstrip
0
1755
by: gene kelley | last post by:
I'm migrating/rewriting one of my VB6 apps to VB2005. In the process, I'm trying to avoid using third party activex controls used in the VB6 project. One of the third party controls in the VB6 app was for menu/toolbars. This control had an option to render the toolbar in an Office 2003 style which is nothing more than a top to bottom gradient. When a new ToolStrip is added to a form, the default appearance of the Toolstrip is that of...
1
6715
by: Alex Clark | last post by:
Hi all, I'm using the ToolStrip in .NET 2.0, and I can't seem to find a way to change the size of it. What I want is a toolbar the size of the IE toolbar, preferably with text below images if possible. Can anyone shed any light on how to do this? Thanks, Alex Clark
0
2266
by: Jon Davis | last post by:
I'm taking the items from a menustrip of a control and moving them to the parent form's menustrip: private void TakeMenus(AdminControl ac) { foreach (Control c in ac.Controls) { if (c is MenuStrip) { MenuStrip ms = (MenuStrip)c;
0
1896
by: Anand Ganesh | last post by:
Hello Everybody, I am using the ToolStrip Control in .NET 2.0. I am also using a ToolStripContainer Control. I want to know how to retain the position of the ToolStrip Control in the ToolStrip Container. For example if user drags the ToolStrip and Docks to the Bottom of the ToolStrip Container.
0
2628
by: Martijn Mulder | last post by:
The ToolStrip on top of my form is to small. I want to increase its height. Simply setting the Height-property doesn't change the height, though. So I tried to place the ToolStrip in a ToolStripPanel, that does react to changes in its Height-property, and by setting the Dock-property of the contained ToolStrip to DockStyle.Fill, I expected the ToolStrip to fill the entire ToolStripPanel. Nope. See the code below, it is ready to run.
6
2810
by: Mike | last post by:
I have a program that is crashing on some machines (at a client of ours). I have determined that it goes down on this line of code: ToolStrip x = new ToolStrip(); I created a simple test app that only performs this one line of code. It throws an exception so I know the problem is not caused by something in my code. It seems like there is a problem with .NET. We have tried uninstalling and reinstalling .NET 2, but it doesn't help.
1
4029
by: Tom P. | last post by:
It's kind of hard to explain (so if you need more just ask) and any help would be greatly appreciated. I am writing a side-by-side file manager. On each side I have a DropDownButton that holds either the root name or the Favorite name for the current path. I also have a DropDownComboBox that has the current full path as well as a series of paths that lead back to the root (i.e. "C;\Program Files\Microsoft Office", "C:\Program Files", "C:...
1
2982
by: priyamtheone | last post by:
In C# 2005 (.Net 2.0), while working with a toolstrip, if its TabStop property is set to TRUE and there are two comboboxes and a button in the toolstrip, why doesn't the button get any focus when the focus is moved from one control to another by pressing the TAB Key. This problem doesn't occur when the TabStop property of the toolstrip is FALSE. But I need the TabStop property to be TRUE. Another problem is while the TabStop property of...
0
8672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7712
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4361
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3038
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.