473,406 Members | 2,343 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,406 software developers and data experts.

C# - Custom ToolStrip

Hi,

I have widely used ToolStrip in my application. I created a UserControl which contains this ToolStrip. I would rather like to use inheritance:

MyCustomControl : ToolStrip

Everything seems to work fine, untill I want to set visibility to one of ToolStripItem - there are maybe 20 buttons and not all of my ChildForms which contains this MyCustomControl need all of them. I open in designer mode in Property window "Items", choose right one and than select "Visibility" > false. In designer mode button dissapear. When compile, designer is reloaded, button is back again.

If I code manually in constructor of ChildForm:

myCustomControl.Items["someButton"].Visible = false;

it worsk OK.

What would you advice me, please?
Sep 19 '09 #1
3 4359
tlhintoq
3,525 Expert 2GB
When compile, designer is reloaded, button is back again.
If the button wasn't visible in the designer how would you ever be able to click on it again to change it's properties? It has to remain visible in the designer in order for you to work with it.

Does it's 'visible' property remain set to 'false' ?
When you actually run your application after setting it to false, does it disappear on the appropriate child forms?
Sep 19 '09 #2
I see property Visible in "Property window" in my Visual Studio.
I also change it to -> False. Than, it turns to bold and it seems to be OK. When I build, designer reloads Form and property is again "True".

When I open Form.designer.cs, I dont see generated row for that
Sep 20 '09 #3
tlhintoq
3,525 Expert 2GB
Sounds like your UserControl is not handling that property correctly.

Since the menu is an item of your new UserControl there would have to be "Visible" properties in the UserControl for each of the items in the ToolStrip. Do you have that?
Sep 20 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Juan Irigoyen | last post by:
I have created custom control that inherits from a control type toolstrip to which I add several buttons to him, when using this control appears to me a control toolstrip but without ningun button,...
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: MLM450 | last post by:
I have created some custom ToolStrip items using ToolStripControlHost. I can not get them to show up in the designer. I have added the ToolStripItemDesignerAvailablility attribute, but it makes no...
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...
3
by: tonFrere | last post by:
Hello, I'm new to C# programming and would like to create a menu strip at form-load, based on the results of a SQL query. The function would create a menu depending on user rights. Do you have any...
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...
4
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi I'm trying to create a composite control to be used on a ToolStrip, consisting of a ToolStripComboBox and a ToolStripButton. It's going to be a control used to search for text in a grid...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.