langalaxy

Hi,

I have a winform which I have integrated into Outlook 2003/07 with VSTO 2005 SE.
The form is translated at runtime.When I test the form outside of outlook, everything works fine.
The buttons expand to the right size and show the whole text.
If I call the form from inside the addin, the buttons don*t size. The text is cut off.

Has any of you experienced the same behaviour


Re: Visual Studio Tools for Office Button text is cut off when using a winform from vsto

Ji Zhou 每 MSFT

Hi Langalaxy,

How do you intergrate the winform into Outlook, as a Custom Task Pane or a Form Region

I have test the winform as a Custom Task Pane intergrated into my Outlook2007.

Code Snippet

private void UserControl1_Load(object sender, EventArgs e)
{
this.button1.Text = "testttttttttttttttttttttttttttttttttttttttttttttttttttttt";
}

Even I use the codes above to assign so long a string to the text property of a button. The button expands to the right size and no texts are cut off! (Ps, you must set the autosize property of the button true)

Thanks

Ji






Re: Visual Studio Tools for Office Button text is cut off when using a winform from vsto

Ji Zhou 每 MSFT

Hi again,

If you are working with a Form Region. For this release VSTO does not provide a design-time experience for custom form regions, you must create the form in Outlook. So when designing the form in outlook, right click the button and click advanced properties. Properties dialog appears, set the property of autosize to true.

Thanks

Ji






Re: Visual Studio Tools for Office Button text is cut off when using a winform from vsto

langalaxy

Hi,

I don*t use a task pane or a custom form region. The Addin creates a new Button in the Ribbon of the mail editor.

The button calls some logic in an extra assembly which contains a normal WinForms window. The text of the buttons on this window is cut off Sad





Re: Visual Studio Tools for Office Button text is cut off when using a winform from vsto

Ji Zhou 每 MSFT

Hi again,

Do you mean when you click the button on the ribbon, winfrom in the extra assembly shows up, and the texts of buttons in it are cut off Where did you get the assembly You write it or get it from elsewhere. Can you code the assembly, the autosize property must be assigned to true, then the button will extend by the length of text.

I have reproduced your scenario by following steps:

  1. I create a winform application using C# in VS 2005
  2. I create a Outlook2007 Addin using C# in VS2005(VSTO SE)
  3. I add winform application as a reference into the Addin project, so we can use the winform.
  4. In the ThisAddIn_Startup, I add codes to show the winform(I have also tested it in a function which invoked by a button in ribbon)
    Code Snippet
    private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
    WindowsApplication1.Form1 myForm = new WindowsApplication1.Form1();
    myForm.Show();
    }

  5. Build the addin , the winform shows up, and everything seems ok. Text on the button is complete.

If I have misunderstanded your issue, please feel free to let me know, so future discussion will be performed to solve your problem.

Thanks

Ji






Re: Visual Studio Tools for Office Button text is cut off when using a winform from vsto

langalaxy

Hi

I tried to reproduce my problem once more and funnily enough it does not appear anymore using Outlook 2003 or 2007 ! All buttons extend their length dynamically, as they should.

The assembly is build by myself. It is a ClassLibrary project and contains a windows form. For all buttons the autosize property is set to true.

Your steps to reproduce the problem are correct, except that you use a WindosApplication.

Perhaps something in my virtual machine went wrong.

I think the problem is solved for the moment, because it does not appear anymore.

Thanks for help

Cristoph