Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / February 2005

Tip: Looking for answers? Try searching our database.

CommandBarControl.OnAction don't want to work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Avi - 13 Feb 2005 11:47 GMT
hi,
i got this code -

Code:
--------------------
 
 CommandBar menuBar = applicationObject.CommandBars["MenuBar"];
 CommandBarControl m_TemplatesControl = menuBar.Controls.Add(MsoControlType.msoControlPopup,1,"",System.Reflection.Missing.Value,true);
 m_TemplatesControl.Visible = true;
 m_TemplatesControl.OnAction = "MyFuncName";
 
--------------------

the problem is that it never being called...
i want that when i press the control it will call the function
(it's popup and not button bcuz it got more commands inside it...)

help please,
Avi.


Carlos J. Quintero [.NET MVP] - 14 Feb 2005 10:21 GMT
You can either cast the CommandBarControl to CommandBarButton and trap its
Click event or you can set an event handler to CommandBarControl with
objDTE.Events.CommandBarEvents(CommandBarControl). But AFAIK the OnAction
property does not fit in the new "Option Strict On" age of VB.NET... ;-)

Signature

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com

> hi,
> i got this code -
[quoted text clipped - 16 lines]
> help please,
> Avi.
"Ed Dore [MSFT]" - 14 Feb 2005 23:58 GMT
Hi Avi,

One thing to try might be to ensure that you scope the CommandBarControl a
bit differently. It looks like this is a local variable that will go out of
scope, and it could be that this is why you are not seeing the event fire.
Typically an addin will make this a member of the object that implements
IExtensibility2.

However, I have not attempted to use this OnAction property before, so
Carlos sugestion might be a better way to go.

Sincerely,
Ed Dore [MSFT]

This post is "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.