Disable print button

Something that I just remembered the other thing you can do is trap the beforetoolactivate event. This way every time the user attempts to use the tool you can either cancel it or disable it.

Here is some c# code, cut and pasted so may have missed copying enough of it. This was designed to keep them from deleting something.

//this goes in the initialize section.
baseToolbarsManager.BeforeToolActivate += new Infragistics.Win.UltraWinToolbars.CancelableToolEventHandler(baseToolbarsManager_BeforeToolActivate);

//
private static void baseToolbarsManager_BeforeToolActivate(object sender, Infragistics.Win.UltraWinToolbars.CancelableToolEventArgs args)
{
if(oTrans.LastView != oTrans.EpiDataViews["UD100A"] && args.Tool.Key == "DeleteTool")
{
baseToolbarsManager.Tools["DeleteTool"].SharedProps.Enabled = false;
args.Cancel = true;
}
else
{
baseToolbarsManager.Tools["DeleteTool"].SharedProps.Enabled = true;
}

}


Jim Kinneman
Encompass Solutions, Inc

--- In vantage@yahoogroups.com, "Stoner, Ken" <kstoner@...> wrote:
>
> Thanks for the heads up, I noticed that early on, I have it working now, with the exception of finding the right events..... which is like finding a needle in a haystack.
>
> Ken Stoner
> IT Manager
>
> GP Innovative Machining & Assembly
> office: +1.270.725.7634
> mobile: +1.270.799.1151
> e-mail: kstoner@...
> website: www.general-products.com
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of jckinneman
> Sent: Wednesday, February 08, 2012 2:48 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Disable print button...
>
>
>
> The other replies give a more complete approach but just for FYI the reason for your error is the use of brackets[], VB likes parenthesis ()
>
> baseToolbarsManager.Tools("PrintTool").SharedProps.enabled = false would disable the print tool button.
>
> One other thing to note that just disabling it when you do a form load may not keep it disabled. Depending on the form it will disable and enable the print tool as it sees fit such as when it load a record. You may need to disable it in other places or via events to ensure it stays disabled.
>
> Jim Kinneman
> Encompass Solutions, Inc
>
> --- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, "Stoner, Ken" <kstoner@> wrote:
> >
> > Hello,
> >
> > Anyone know how to disable a toolbar button using VB?
> >
> > I have found some references to: baseToolbarsManager.Tools["PrintTool"].SharedProps.enabled = false
> >
> > Which I tried putting on the form load event (this is in the customer shipment screen).
> >
> > I get a compile error: Error: BC30545 - line 333 (1227) - Property access must assign to the property or use its value.
> > Error: BC30203 - line 333 (1227) - Identifier expected.
> >
> > Thanks!
> >
> > Ken
> > ________________________________
> > "This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
> ________________________________
> "This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."
>
>
> [Non-text portions of this message have been removed]
>
Hello,

Anyone know how to disable a toolbar button using VB?

I have found some references to: baseToolbarsManager.Tools["PrintTool"].SharedProps.enabled = false

Which I tried putting on the form load event (this is in the customer shipment screen).

I get a compile error: Error: BC30545 - line 333 (1227) - Property access must assign to the property or use its value.
Error: BC30203 - line 333 (1227) - Identifier expected.

Thanks!

Ken
________________________________
"This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."


[Non-text portions of this message have been removed]
This is how we remove the Delete

Dim ToolMgr As UltraToolbarsManager = GetType(Epicor.Mfg.UI.App.PartEntry.PartForm).InvokeMember("baseToolbarsManager", BindingFlags.GetField Or BindingFlags.NonPublic Or BindingFlags.Instance, Nothing, PartForm, Nothing)
If (ToolMgr.Tools.Exists("DeleteTool"))
If (ToolMgr.Toolbars.Exists("Standard Tools"))
ToolMgr.Toolbars("Standard Tools").Tools("DeleteTool").InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False
End If





David Penn
Software Developer
Tel: (260) 918-1559
Fax: (260) 482-4165
www.pyromation.com
E-mail: dpenn@...<mailto:dpenn@...>

[Description: Pyro_4c_Logo-Tag-1.8-email]

5211 Industrial Road, Fort Wayne, IN 46825 USA



[Non-text portions of this message have been removed]
Use the top bit or code to find the name of the button (get the sub by going through the wizard then add the messagebox line). After you find the name replace RefreshTool with the name in the messagebox.

   Private Sub baseToolbarsManager_ToolClick(ByVal sender As Object, ByVal args As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs)
      MessageBox.Show(args.Tool.Key.ToString())
   End Sub

   Private Sub JobEntryForm_Load(ByVal sender As Object, ByVal args As EventArgs)
      ' Add Event Handler Code
      baseToolbarsManager.Tools("RefreshTool").SharedProps.Enabled = false
   End Sub



________________________________
From: "Stoner, Ken" <kstoner@...>
To: "vantage@yahoogroups.com" <vantage@yahoogroups.com>
Sent: Wednesday, February 8, 2012 9:37 AM
Subject: [Vantage] Disable print button...

Hello,

Anyone know how to disable a toolbar button using VB?

I have found some references to: baseToolbarsManager.Tools["PrintTool"].SharedProps.enabled = false

Which I tried putting on the form load event (this is in the customer shipment screen).

I get a compile error:Â Â Error: BC30545 - line 333 (1227) - Property access must assign to the property or use its value.
                 Error: BC30203 - line 333 (1227) - Identifier expected.

Thanks!

Ken
________________________________
"This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."


[Non-text portions of this message have been removed]



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.%c2%a0
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links



[Non-text portions of this message have been removed]
The other replies give a more complete approach but just for FYI the reason for your error is the use of brackets[], VB likes parenthesis ()

baseToolbarsManager.Tools("PrintTool").SharedProps.enabled = false would disable the print tool button.

One other thing to note that just disabling it when you do a form load may not keep it disabled. Depending on the form it will disable and enable the print tool as it sees fit such as when it load a record. You may need to disable it in other places or via events to ensure it stays disabled.

Jim Kinneman
Encompass Solutions, Inc

--- In vantage@yahoogroups.com, "Stoner, Ken" <kstoner@...> wrote:
>
> Hello,
>
> Anyone know how to disable a toolbar button using VB?
>
> I have found some references to: baseToolbarsManager.Tools["PrintTool"].SharedProps.enabled = false
>
> Which I tried putting on the form load event (this is in the customer shipment screen).
>
> I get a compile error: Error: BC30545 - line 333 (1227) - Property access must assign to the property or use its value.
> Error: BC30203 - line 333 (1227) - Identifier expected.
>
> Thanks!
>
> Ken
> ________________________________
> "This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."
>
>
> [Non-text portions of this message have been removed]
>
That's the problem,

When I add "baseToolbarsManager.Tools["PrintTool"].SharedProps.enabled = false" to the formload event

"PrintTool" is the correct button.

I get:
BC30545 - line 333 (1227) - Property access must assign to the property or use its value.
Error: BC30203 - line 333 (1227) - Identifier expected.

Ken

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Ted Koch
Sent: Wednesday, February 08, 2012 9:16 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Disable print button...



Use the top bit or code to find the name of the button (get the sub by going through the wizard then add the messagebox line). After you find the name replace RefreshTool with the name in the messagebox.

Private Sub baseToolbarsManager_ToolClick(ByVal sender As Object, ByVal args As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs)
MessageBox.Show(args.Tool.Key.ToString())
End Sub

Private Sub JobEntryForm_Load(ByVal sender As Object, ByVal args As EventArgs)
' Add Event Handler Code
baseToolbarsManager.Tools("RefreshTool").SharedProps.Enabled = false
End Sub

________________________________
From: "Stoner, Ken" <kstoner@...<mailto:kstoner%40general-products.com>>
To: "vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>" <vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>>
Sent: Wednesday, February 8, 2012 9:37 AM
Subject: [Vantage] Disable print button...

Hello,

Anyone know how to disable a toolbar button using VB?

I have found some references to: baseToolbarsManager.Tools["PrintTool"].SharedProps.enabled = false

Which I tried putting on the form load event (this is in the customer shipment screen).

I get a compile error: Error: BC30545 - line 333 (1227) - Property access must assign to the property or use its value.
Error: BC30203 - line 333 (1227) - Identifier expected.

Thanks!

Ken
________________________________
"This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."

[Non-text portions of this message have been removed]

------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.<http://groups.yahoo.com/group/vantage/files/>
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links

[Non-text portions of this message have been removed]

________________________________
"This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."


[Non-text portions of this message have been removed]
This is close....

Dim ToolMgr As UltraToolbarsManager = GetType(Epicor.Mfg.UI.App.CustShipEntry.CustShipForm).InvokeMember("baseToolbarsManager", BindingFlags.GetField Or BindingFlags.NonPublic Or BindingFlags.Instance, Nothing, CustShipForm, Nothing)

If (ToolMgr.Tools.Exists("DeleteTool"))
If (ToolMgr.Toolbars.Exists("Standard Tools"))

ToolMgr.Toolbars("Standard Tools").Tools("DeleteTool").InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False

End If

However I'm getting: Error: BC30002 - line 341 (1238) - Type 'UltraToolbarsManager' is not defined.

Ken Stoner
IT Manager

GP Innovative Machining & Assembly
office: +1.270.725.7634
mobile: +1.270.799.1151
e-mail: kstoner@...
website: www.general-products.com

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of David Penn
Sent: Wednesday, February 08, 2012 8:59 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Disable print button...



This is how we remove the Delete

Dim ToolMgr As UltraToolbarsManager = GetType(Epicor.Mfg.UI.App.PartEntry.PartForm).InvokeMember("baseToolbarsManager", BindingFlags.GetField Or BindingFlags.NonPublic Or BindingFlags.Instance, Nothing, PartForm, Nothing)
If (ToolMgr.Tools.Exists("DeleteTool"))
If (ToolMgr.Toolbars.Exists("Standard Tools"))
ToolMgr.Toolbars("Standard Tools").Tools("DeleteTool").InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False
End If

David Penn
Software Developer
Tel: (260) 918-1559
Fax: (260) 482-4165
www.pyromation.com
E-mail: dpenn@...<mailto:dpenn%40pyromation.com><mailto:dpenn@...<mailto:dpenn%40pyromation.com>>

[Description: Pyro_4c_Logo-Tag-1.8-email]

5211 Industrial Road, Fort Wayne, IN 46825 USA

[Non-text portions of this message have been removed]

________________________________
"This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."


[Non-text portions of this message have been removed]
Ken,
If you want to remove the print icon from the menu this is c# code that I tested this morning. You may need to add reference to the Infragistics dll.

if (ToolMgr.Tools.Exists("PrintTool"))
{
if (ToolMgr.Toolbars.Exists("Standard Tools"))
{
ToolMgr.Toolbars["Standard Tools"].Tools["PrintTool"].InstanceProps.Visible =Infragistics.Win.DefaultableBoolean.False;
}
}



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Stoner, Ken
Sent: Wednesday, February 08, 2012 4:29 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Disable print button...



That's the problem,

When I add "baseToolbarsManager.Tools["PrintTool"].SharedProps.enabled = false" to the formload event

"PrintTool" is the correct button.

I get:
BC30545 - line 333 (1227) - Property access must assign to the property or use its value.
Error: BC30203 - line 333 (1227) - Identifier expected.

Ken

From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of Ted Koch
Sent: Wednesday, February 08, 2012 9:16 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] Disable print button...

Use the top bit or code to find the name of the button (get the sub by going through the wizard then add the messagebox line). After you find the name replace RefreshTool with the name in the messagebox.

Private Sub baseToolbarsManager_ToolClick(ByVal sender As Object, ByVal args As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs)
MessageBox.Show(args.Tool.Key.ToString())
End Sub

Private Sub JobEntryForm_Load(ByVal sender As Object, ByVal args As EventArgs)
' Add Event Handler Code
baseToolbarsManager.Tools("RefreshTool").SharedProps.Enabled = false
End Sub

________________________________
From: "Stoner, Ken" <kstoner@...<mailto:kstoner%40general-products.com><mailto:kstoner%40general-products.com>>
To: "vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com>" <vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com>>
Sent: Wednesday, February 8, 2012 9:37 AM
Subject: [Vantage] Disable print button...

Hello,

Anyone know how to disable a toolbar button using VB?

I have found some references to: baseToolbarsManager.Tools["PrintTool"].SharedProps.enabled = false

Which I tried putting on the form load event (this is in the customer shipment screen).

I get a compile error: Error: BC30545 - line 333 (1227) - Property access must assign to the property or use its value.
Error: BC30203 - line 333 (1227) - Identifier expected.

Thanks!

Ken
________________________________
"This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."

[Non-text portions of this message have been removed]

------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.<http://groups.yahoo.com/group/vantage/files/><http://groups.yahoo.com/group/vantage/files/>
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links

[Non-text portions of this message have been removed]

________________________________
"This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."

[Non-text portions of this message have been removed]



[Non-text portions of this message have been removed]
Thanks for the heads up, I noticed that early on, I have it working now, with the exception of finding the right events..... which is like finding a needle in a haystack.

Ken Stoner
IT Manager

GP Innovative Machining & Assembly
office: +1.270.725.7634
mobile: +1.270.799.1151
e-mail: kstoner@...
website: www.general-products.com

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of jckinneman
Sent: Wednesday, February 08, 2012 2:48 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Disable print button...



The other replies give a more complete approach but just for FYI the reason for your error is the use of brackets[], VB likes parenthesis ()

baseToolbarsManager.Tools("PrintTool").SharedProps.enabled = false would disable the print tool button.

One other thing to note that just disabling it when you do a form load may not keep it disabled. Depending on the form it will disable and enable the print tool as it sees fit such as when it load a record. You may need to disable it in other places or via events to ensure it stays disabled.

Jim Kinneman
Encompass Solutions, Inc

--- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, "Stoner, Ken" <kstoner@...> wrote:
>
> Hello,
>
> Anyone know how to disable a toolbar button using VB?
>
> I have found some references to: baseToolbarsManager.Tools["PrintTool"].SharedProps.enabled = false
>
> Which I tried putting on the form load event (this is in the customer shipment screen).
>
> I get a compile error: Error: BC30545 - line 333 (1227) - Property access must assign to the property or use its value.
> Error: BC30203 - line 333 (1227) - Identifier expected.
>
> Thanks!
>
> Ken
> ________________________________
> "This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."
>
>
> [Non-text portions of this message have been removed]
>

________________________________
"This e-mail and the files transmitted with it are the property of General Products, are confidential, and are intended solely for use of the individual or entity to whom this e-mail is addressed. If you (a) are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, or (b) are unwilling or unable to maintain the confidentiality of this email and the files transmitted with it, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."


[Non-text portions of this message have been removed]