开发者

Autosize datagridview in usercontrol

Hi i am developing a custom panel for outlook. and i have a question, how can i autosize width and height the datagridview to the userControl?

This is what append: alt text http://a.imageshack.us/img180/6938/custompanel.png

Edit:

Microsoft.Office.Tools.CustomTaskPane taskPane;
        Microsoft.Office.Interop.Outlook.Application applicationObject;
        Outlook.Explorer explorer;
        TaskPaneControl tpc;
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            explorer = this.Application.ActiveExplorer();
            explorer.SelectionChange+=new Microsoft.Office.Interop.Outlook.ExplorerEvents_10_SelectionChangeEventHandler(explorer_SelectionChange);
        }

        void explorer_SelectionChange()
        {
            if (taskPane == null)
            {
                tpc=new TaskPaneControl();
                taskPane = Globals.ThisAddIn.CustomTaskPanes.Add(tpc, "Sender Details", explorer);
                taskPane.Visible = true;
                taskPane.Width = 245;
                return;
            }

            if (taskPane != null)
            {
                taskPane.Visible = true;
                taskPane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionBottom;
                taskPane.Height = 245;
                }
   开发者_如何学JAVA         }
        }

And added a TaskPaneControl (userControl)


Check that you have set the Anchor property to all four directions, or the Dock property to DockStyle.Fill.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜