Custom toolbar doesn't firing Event in code

T

totoen4

Hi,

I have a form that I want to convert (2003 to 2007) my Infopath form,
but now the button on my custom toolbar doesn't firing.

In this article it's explain how to make custom toolbar in Infopath
2007:
http://msdn.microsoft.com/en-us/library/bb251008.aspx
But nothing is say about how to bind it with the C# code.

When I click on one of my toolbar button nothing is doing (this was
good working before the conversion). Can you help me?

I use VS 2005, Infopath 2007 with C#.

The declaration in the manifest:
<xsf:toolbar caption="AV Toolbar" name="AV_Toolbar">
<xsf:button name="Quit" caption="Abbrechen"></xsf:button>
</xsf:toolbar>

The link to the event in the internal startup:
((ButtonEvent)EventManager.ControlEvents["Quit"]).Clicked += new
ClickedEventHandler(Quit_Clicked);

the event in my code:
public void Quit_Clicked(object sender, ClickedEventArgs e)
{

MessageBox.Show("Hello world");

}

What is wrong ? Could you help me?

Thanks
 
G

Greg Collins

The name attribute of your custom toolbar button is the name of the button
event you need to add in your code.

So if you have <xsf:button name="btnMyToolbarButton" . . . /> then you need
an a click event named "btnMyToolbarButton" that follows the click even
handler syntax for the coding language you are using.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top