David Gristwood

I¡¯m seeing some strange behaviour with ActionPaneControl in VS2008 beta 2 ¨C it might be a bug or something subtle I am no doing.

Following the MSDN vs2008 beta 2 library examples to create an ActionPaneControl document level control, all seems fine. But if I add a text box and button onto the ActionPaneControl, when I pick up the button click event, when I read the contents of the text box, it returns the value at design time, not the value just entered at runtime.

Is this a bug I am programming this like I would a normal winforms control. Do I need to do some form of refresh to get the latest data or am i missing something simple :-)

namespace VSTOWordTemplate1
{
partial class ActionsPaneControl1 : UserControl
{
public ActionsPaneControl1()
{
InitializeComponent();

// added for action pane
InitializeComponent();
this.button1.Click += new EventHandler(this.button1_Click);
}



private void button1_Click(object sender, EventArgs e)
{

// this next line doens't return actual value entered at runtime in the text box

string s = textBox1.Text;



Re: Visual Studio Tools for Office Strange behaviour with ActionPaneControl in VS2008 beta 2

Ji Zhou ¨C MSFT

Hi

Which MSDN sample did you follow, could you please post its address I try, but cannot reproduce your issue. I am using Winform UserControl. Are you working with the WPF user controls

Thanks

Ji






Re: Visual Studio Tools for Office Strange behaviour with ActionPaneControl in VS2008 beta 2

David Gristwood

Hi Ji,

i just posted reply saying it had found the answer:

InitializeComponent();

// added for action pane
InitializeComponent();
this.button1.Click += new EventHandler(this.button1_Click);

notice the two InitializeComponent() calls! thats the problem. it will teach me to cut and paste from samples with more care!

thanks for checking it out. its strange that two call to InitializeComponent() do mess things up

David