473,385 Members | 1,397 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 3000
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********@ashutosh.inwrote in message
news:ek**************@TK2MSFTNGP05.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
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...
0
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...
1
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...
0
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...
0
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...
0
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...
6
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...
1
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...
1
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.