none
DragEventArgs DataObject VS2008 problem RRS feed

  • Question

  • Hi there everybody,

    I have a custom editor which i've added a DragDrop handler too.  In VS2005, when the handler was fired a DragEventArgs object was passed in with an instance of IDataObject that was actually a custom type I created.  However, when I run this plug-in using VS2008, the DragEventArgs comes back with a System.Windows.Forms.DataObject which I have no idea what to do with.

    I've added the code that adds the custom type (TextDataObject) to the toolbox service.

                // Create a TextDataObject to use for drag and drop operations on the designer
                TextDataObject dataObject = new TextDataObject(bbControlFormat, name, data);

                Bitmap bmp = new Bitmap(typeof(MdsFormEditorToolbox), "Resources." + resource);
                uint clrTransparent = (uint)System.Drawing.ColorTranslator.ToWin32(Color.Fuchsia);

                // Declare toolbox item structure
                TBXITEMINFO[] tbxInfo;
                tbxInfo = new TBXITEMINFO[1];
                tbxInfo[0].bstrText = name;
                tbxInfo[0].hBmp = System.Windows.Forms.ControlPaint.CreateHBitmap16Bit(bmp, Color.Fuchsia);
                tbxInfo[0].clrTransparent = clrTransparent;
                int result = svc.AddItem(dataObject, tbxInfo, BlackberryConstants.TabName);


    Anybody have any suggestions on what I can do to get this working in both 2005 and 2008?

    Thanks everybody,

    Adrian
    Thursday, January 24, 2008 7:57 PM