Please help !

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gary

    #1

    Please help !

    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


  • Dmitriy Lapshin [C# / .NET MVP]

    #2
    Re: Please help !

    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.

    --
    Dmitriy Lapshin [C# / .NET MVP]
    X-Unity Test Studio

    Bring the power of unit testing to VS .NET IDE

    "Gary" <msnews@microso ft.com> wrote in message
    news:%23SpN0ipc DHA.616@TK2MSFT NGP11.phx.gbl.. .[color=blue]
    > 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[/color]
    fine[color=blue]
    > 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
    >
    >[/color]

    Comment

    Working...