在用户控件中自动调整数据网格视图的大小
您好,我正在开发 Outlook 的自定义面板。 我有一个问题,如何自动调整 datagridview 到 userControl 的宽度和高度?
这是附加的内容: 替代文本 http://a.imageshack.us/img180/6938/custompanel.png< /a>
编辑:
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;
}
}
}
并添加了一个TaskPaneControl(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;
}
}
}
And added a TaskPaneControl (userControl)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查是否已将
Anchor
属性设置为所有四个方向,或将Dock
属性设置为DockStyle.Fill
。Check that you have set the
Anchor
property to all four directions, or theDock
property toDockStyle.Fill
.