Please help !

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hi,
I am working with drag and drop functionality.
I am draging a button and dropping in a text box. I am able to drop only
button text value.
1) Can i drop button itself?
2) If i work with a single form in a project having [STAThread] it work fine
but in my project my start page is login - and drag and drop does not have
[STAThread] so it displays an error "dragdrop registration failed" and i
cant include my [stathread] in my drag and drop page too..

Please help !

TIA,
Gary
 
Hi,

How would you imagine dropping the button itself to the text box? The text
box is capable of displaying only a plain text, it cannot host any controls
within. Even for the RichTextBox control, the control hosted should be an
ActiveX control and .NET WinForms controls do not support ActiveX.

As for the [STAThread], it seems I cannot understand what the problem is.
The STAThread attribute is usually applied to the static Main method, not to
a particular form and you do have to be in the single thread to employ
Drag&Drop as it is OLE-based and expects a Single-Threaded apartment.

P.S. The Sep 2003 issue of MSDN Magazine has an article about remote
clipboard that, in particular, tackles STA/MTA issues. You can refer to this
article to find out some additional details.
 
Back
Top