Select to view content in your preferred language

No overload for method error

945
3
Jump to solution
02-22-2013 08:35 AM
KP
by
Deactivated User
I have the following error "No overload for method 'GetCaption' takes '0' arguments" for the following code (Visual C# 2008 Express):
 public class Test : ESRI.ArcGIS.Desktop.AddIns.Button     {         public Test()         {         }          public void GetCaption (IApplication application)         {             string strDisplayField;             strDisplayField = application.Caption;             MessageBox.Show(strDisplayField);         }                  protected override void OnClick()         {             GetCaption();              ArcMap.Application.CurrentTool = null;         }         protected override void OnUpdate()         {             Enabled = ArcMap.Application != null;         }     }
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
Don't you need to pass in the application?
GetCaption(ArcMap.Application);

View solution in original post

0 Kudos
3 Replies
KenBuja
MVP Esteemed Contributor
Don't you need to pass in the application?
GetCaption(ArcMap.Application);
0 Kudos
KP
by
Deactivated User
I do now.  I really appreciate it!
0 Kudos
KenBuja
MVP Esteemed Contributor
Glad to help. Don't forget to click the check mark on the post that answered your question.
0 Kudos