Web Form Designer: How to activate it to allow Menu Paste to add control at design time

Hi all.

I have a web form displayed in my IDE.
I have created an 'HTML Format' clipboard item say representing a Label control.
This is done via a dialog so the web form does not have focus.

How do I programmatically 'click' on the web form surface (after closing my dialog) which in turn will activate the IDE Paste button, which I can then invoke to paste the control from the clipboard.

I have tried SendMessage, and other api calls, to the various window objects that appear to be the right ones, but I cannot get the form to activate. Simply clicking on the form manually works. This must be solvable.

Thanks for any assistance.


Answer this question

Web Form Designer: How to activate it to allow Menu Paste to add control at design time

  • chacke

    Thanks for your reply.

    After much searching (by trying to think laterally - because often you cannot find the answer by the question you would expect to use) I found out how to acheive drag and drop and design time, in order to instantiate the web control of my choice after first having set its html structure.



  • Jijo P Baby

    If you have access to the automation model, you can call DTE.Windows.Item(...).Activate(). The only value you need is the param to pass to the Item method. This value will be the file name of the window to activate, meaning that if your web file is at C:\myWeb\File.aspx, you will pass File.aspx.

    Craig

  • Web Form Designer: How to activate it to allow Menu Paste to add control at design time