ToolStripMenu
-
How to lock ToolstripMenu form adding new items!
-
How to lock ToolstripMenu form adding new items!
Well don't add any Items to it. It's YOU and eventually YOUR code that adds an item to the toolstrip menu. If you have a pice of code that dynamically adds items at runtime, than make some sort of logic/condition to not allow any Items to be added unless the condition is satisfied.
-
Well don't add any Items to it. It's YOU and eventually YOUR code that adds an item to the toolstrip menu. If you have a pice of code that dynamically adds items at runtime, than make some sort of logic/condition to not allow any Items to be added unless the condition is satisfied.
I have usercontrol that inherant form toolstrip, now how can i disable tsmi task!
-
I have usercontrol that inherant form toolstrip, now how can i disable tsmi task!
-
jojoba2010 wrote:
now how can i disable tsmi task!
I really don't want to offend you but I just DO NOT understand your question. Please use Google Translate or something.
I wanna to have tooltip that just have 12items and user(programmer) cannot remove these items!
-
I wanna to have tooltip that just have 12items and user(programmer) cannot remove these items!
Just add a normal
MenuStrip
object to your form. It doesn't have that functionality by default. Are you by chance talking about aToolStrip
?.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
I wanna to have tooltip that just have 12items and user(programmer) cannot remove these items!
Are you building an application or an add in for VS
Never underestimate the power of human stupidity RAH
-
Are you building an application or an add in for VS
Never underestimate the power of human stupidity RAH
Yes i am talking about ToolStrip! And wanna disable toolstrip Task(in design view we have toolstrip Task) where we can add/Delete new items !
-
I wanna to have tooltip that just have 12items and user(programmer) cannot remove these items!
First - did you make a custom control derived from ToolStripMenu? If YES than the only way I can think of how you could force that, is by overriding the methods/events such as myCoolMenuStrip1.ItemAdded and do nothing in there. Something like:
protected override void OnItemAdded(ToolStripItemEventArgs e)
{
//do absolutely nothing
//base.OnItemRemoved(e);
}protected override void OnItemRemoved(ToolStripItemEventArgs e)
{
//do absolutely nothing
//base.OnItemRemoved(e);
}If Not state more clearly what you want.
-
Yes i am talking about ToolStrip! And wanna disable toolstrip Task(in design view we have toolstrip Task) where we can add/Delete new items !
The ToolStrip can be locked by using one or more properties, disallowing removal of buttons. I don't know what these properties are, but a little googling should help.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
First - did you make a custom control derived from ToolStripMenu? If YES than the only way I can think of how you could force that, is by overriding the methods/events such as myCoolMenuStrip1.ItemAdded and do nothing in there. Something like:
protected override void OnItemAdded(ToolStripItemEventArgs e)
{
//do absolutely nothing
//base.OnItemRemoved(e);
}protected override void OnItemRemoved(ToolStripItemEventArgs e)
{
//do absolutely nothing
//base.OnItemRemoved(e);
}If Not state more clearly what you want.
public partial class
UserControl1 : ToolStrip
And i have added 10 items to this Toolstrip and now i wanna to force every-one who use this usercontrol from remove these items from this menuStrip! -
public partial class
UserControl1 : ToolStrip
And i have added 10 items to this Toolstrip and now i wanna to force every-one who use this usercontrol from remove these items from this menuStrip!please insert the code that you have so far, that is if you have any. And be SPECIFIC like "I want the user of the control not to be able to remove or add anything" Or "I want the user not to be able to remove any Item but be able to Add". Anyway post what you have.
-
please insert the code that you have so far, that is if you have any. And be SPECIFIC like "I want the user of the control not to be able to remove or add anything" Or "I want the user not to be able to remove any Item but be able to Add". Anyway post what you have.
this is the exact thing i want :
I want the user not to be able to remove any Item but be able to Add
for user control that inherent from toolstrip; So please Help!!!!!!!!!!!! -
this is the exact thing i want :
I want the user not to be able to remove any Item but be able to Add
for user control that inherent from toolstrip; So please Help!!!!!!!!!!!!From my understanding. You have created a usercontrol that has a number of items. If someone else uses this control, you do not want any of those items to be visible? If this is the case then you will want to have some form of mechanism that checks if the user has authority to use those items. If they do not then when the control is initialised then emove those items, else them them there. Is that what you mean?
Dave Don't forget to vote on messages! Find Me On: Web|Facebook|Twitter|LinkedIn Waving? dave.m.auld[at]googlewave.com
-
From my understanding. You have created a usercontrol that has a number of items. If someone else uses this control, you do not want any of those items to be visible? If this is the case then you will want to have some form of mechanism that checks if the user has authority to use those items. If they do not then when the control is initialised then emove those items, else them them there. Is that what you mean?
Dave Don't forget to vote on messages! Find Me On: Web|Facebook|Twitter|LinkedIn Waving? dave.m.auld[at]googlewave.com
No i wanna these items be visible for them but they wont be able do remove these default items!
modified on Sunday, January 31, 2010 11:48 AM