Writing Add-Ins for Visual Studio .NET
|
| < Free Open Study > |
|
Change a Property on a Form
Properties of components on a form are referenced through the IDesignerHost object, in much the same way that properties on a form are referenced.
The following code snippet references the Size property of a form. The Size property was chosen because a System.Drawing.Size object must be used, which is a little more involved than a simple String property. Note that the active window must contain a WinForms Designer. The comments in the code describe what is taking place in the code.
' Get a forms designer host object Dim fdHost As IDesignerHost If applicationObject.ActiveWindow.Caption.
|
| < Free Open Study > |
|