beaniecopter
Tue Jul 18 22:59:01 CDT 2006
Linda,
Thanks for pointing me in the right direction. After much selective
commenting of code, I determined the problem was caused by a line in the
InitializeComponent routine. Believe it or not, the code was:
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
One may wonder:
1. Why would that code appear in the InitializeComponent code of a base
(template) form?
2. Why does the Visual Studio designer even care?
As I mentioned, this is an existing application being converted from VS 2003
to VS 2005. I really can't speculate why someone thought that line was
needed. When I removed the line, I was able to drag and drop fields from the
Data Source window onto an inherited form. When I put that one line back in,
the drag problem reappeared. Surprising, to say the least.
I suppose the more intriguing question is why that code causes the VS 2005
IDE to think that it is unable to to place a new data bound control on the
inherited form. Since I spent quite a few hours on this issue already, I
will happily move on with my solution even though I don't fully understand
why it worked.
Thanks for your assistance.
Regards,
Jo-Anne V
"Linda Liu [MSFT]" wrote:
> Hi Jo-Anne,
>
> Thank you for posting.
>
> I have performed a test on this issue and confirmed that the problem is not
> related to the project's conversion from VS 2003 to VS 2005.
>
> In fact, when a control is dragged from toolbar and dropped onto the
> TabPage2, what the VS IDE does is to generate some code such as creating
> new control, adding it to the Controls property of the TabPage2, binding
> the control to a data source and so on in the InitializeComponent method in
> the inherited form.
>
> I think if VS IDE couldn't generate all these corresponding code, the
> drag&drop operation will be forbidden.
>
> Since you could drag&drop regular toolbar controls onto the TabPage2 in the
> inherited form, the code of creating controls and adding them to the
> Controls property of the TabPage2 are able to generated.
>
> You may have a try dragging the table from Data Source pane and dropping it
> onto the inherited form itself to see if the drop operation works. If the
> result is Yes, the code of the data binding is able to generated.
>
> You may comment out all the code within the InitializeComponent method of
> the inherited form and drag&drop the table onto the TabPage2.
>
> Hope this helps.
>
>
> Sincerely,
> Linda Liu
> Microsoft Online Community Support
>
> ============================================================================
> =============================================
> Get notification to my posts through email? Please refer to
>
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
>
> With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
> to the limited number of phone-based technical support incidents. Complex
> issues or server-down situations are not recommended for the newsgroups.
> Issues of this nature are best handled working with a Microsoft Support
> Engineer using one of your phone-based incidents.
>
> ============================================================================
> =============================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>