![]() ![]() There are some things to keep in mind when you create user controls:ĭo not create a sealed user control. You can then drag the user control directly to your document in the same way you would add a Windows Forms control to your document. You can add a user control to your project and then add it to the Toolbox. Some aspects of using Windows Forms controls on documents are unique to document-level projects, which enable you to design the UI of your document by using the Visual Studio designer. Use Windows Forms controls in document-level projects These helper methods enable you to quickly add controls to your Office document and access the combined Windows Forms control functionality and Office-related functionality of these controls.įor more information, see Add controls to Office documents at run time. The Visual Studio Tools for Office runtime provides helper methods for adding the most common Windows Forms controls. You can add Windows Forms controls to Word documents and Excel worksheets at run time. When you want to get input from the user, and prevent the user from doing anything in the document until the input is received.Īdd Windows Forms controls programmatically When you want to prevent users from hiding or deleting the controls. When you want to control the size of the UI. When you want to ensure that controls do not interfere with the view of the document. When you want to ensure that the controls are not printed with the document. When you want only the results to appear in the document, and not the query controls and data. When you want to provide contextual information to the user. On the actions pane or a custom task pane. For example, if you are adding buttons to each row of a list object, you would want them in line with each list item. When you want the controls to display in line with the data in the document. When you want users to enter data directly in the document, for example, in forms-based documents where the editing surface is locked. When you want to display the controls 100% of the time. ![]() When designing the UI of your solution, consider the uses of Windows Forms controls as described in the following table. The decision whether to add Windows Forms controls to a document or some other UI element depends on several factors. For information, see Limitations of Windows Forms controls on Office documents. Windows Forms controls generally have the same behavior on documents as on these other UI elements, but some differences do exist. You can add Windows Forms controls to documents and to customizable user interface (UI) elements, including actions panes, custom task panes, and Windows Forms. For more information, see Features available by Office application and project type. You can programmatically add these controls to any open document or worksheet at run time in a VSTO Add-in for Excel or Word.įor more information, see How to: Add Windows Forms controls to Office documents.Īpplies to: The information in this topic applies to document-level projects and VSTO Add-in projects for Excel and Word. In document-level projects for Microsoft Office Excel and Microsoft Office Word, you can add Windows Forms controls to the document or workbook in your project at design time, or you can programmatically add these controls at run time. Windows Forms controls are objects that users can interact with to enter or manipulate data. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |