Tool Bar caption

Add-in Express™ Support Service
That's what is more important than anything else

Tool Bar caption
 
Ashish Sharma


Guest


Hi,

i had a toolbar control in which i had added three button

button1 -> will open a new form having one button and on clicking the buttong the caption of "third button" shd change to "Ashish"
coding in button click even

Dim abc As New AddinModule
bc.AdxCommandBarButton3.Caption = "Ashish"
'the above code is not working
how to change the caption of the tool bar button using a button in a form

i m using normal window forms.


button2 -> will change the caption to "butn2 click" and the coding is writtedn in addin forms
AdxCommandBarButton2.Caption = "butn2 click"
this one is working fine

Posted 26 Mar, 2008 04:51:46 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ashish.

The code above will never work because you create a new instance of the addinmodule. Please use the AddinExpress.MSO.ADXAddinModule.CurrentInstance static field to access the existing addinmodule.
Posted 26 Mar, 2008 05:52:08 Top
Ashish Sharma


Guest


Hi Sergey ,

Can you please send me the whole code to change the caption of the tool bar button.
Posted 26 Mar, 2008 06:03:38 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
AddinExpress.MSO.ADXAddinModule.CurrentInstance.AdxCommandBarButton3.Caption = "Ashish"
Posted 26 Mar, 2008 08:54:21 Top
Ashish Sharma


Guest


Hi Sergey

I got an error after using the above code

'AdxCommandBarButton3' is not a member of'AddinExpress.MSO.ADXAddinModule'.
Posted 27 Mar, 2008 04:21:55 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Yes, right. You just need to change the access modifier of the 'AdxCommandBarButton3' component to 'public'.
Posted 27 Mar, 2008 07:34:43 Top
Ashish Sharma


Guest


Hi,

I already tried the above code after changing the access modifier ofthe 'AdxCommandBarButton3' component to 'public'

but it did'nt work out
Posted 27 Mar, 2008 08:22:21 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
I guess you set the 'Option Strict' to On in your project. You need to set it to Off and compiler will not check types when you build the project.
Posted 27 Mar, 2008 09:12:50 Top
Ashish Sharma


Guest


Hi

i had not set "option strict" to On in my project.
Posted 27 Mar, 2008 09:22:46 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Please try the following code:

Dim m As AddinModule = AddinExpress.MSO.ADXAddinModule.CurrentInstance
m.AdxCommandBarButton1.Caption = "Ashish"
Posted 27 Mar, 2008 11:56:14 Top