alors là je ne sais pas si il y a plus simple mais j'ai un moyen :
qq part dans le code du form appelant :
printPreviewDialog1.Show();
// recherche du controle toolbar
foreach( Control ctrl in printPreviewDialog1.Controls)
{
if ( ctrl.GetType().FullName == "System.Windows.Forms.ToolBar")
{
ToolBar toolbar = (ToolBar)ctrl;
// et on "s'abonne" a l'evenement
toolbar.ButtonClick += new ToolBarButtonClickEventHandler(toolbar_ButtonClick);
}
}
methode toolbar_ButtonClick dans le form appelant :
private void toolbar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
// le bouton imprimer est le premier bouton du toolbar
if ( e.Button == e.Button.Parent.Buttons[0] )
MessageBox.Show("Imprimer");
}
Cocoricoooooooo !!!!