Page 1 of 1

ATL 8.0 + own context menu

Posted: 09 Apr 2008, 06:02
by godeny
Hello Tiku,

when i set the DragMode property to 1 - vbAutomatic, then . when the Unicode Edit Control loosis the focus, the control disappears, and a text "ATL 8.0" will be displayed instead of the control.

The RegisterForOLEDragDrop property is 1.

Can i use the DragMode property to let the control automatically handle OLE Drag operations (or it is only for the old style dragging) ?

-----

How can i disable the context menu - for using my own context menu ?

Thank you in advance,

Zoltan

Re: ATL 8.0 + own context menu

Posted: 09 Apr 2008, 10:58
by TiKu
godeny wrote:when i set the DragMode property to 1 - vbAutomatic, then . when the Unicode Edit Control loosis the focus, the control disappears, and a text "ATL 8.0" will be displayed instead of the control.
This damn "ATL 8.0" bug has been dogging me for years. It shows up in my controls here and there and I still don't know the reason.
I'll try to fix it, but I can't promise anything.
godeny wrote:Can i use the DragMode property to let the control automatically handle OLE Drag operations (or it is only for the old style dragging) ?
The DragMode property comes from the VB runtime and not from my control. I think it can be used for dragging the control itself. At least it has nothing to do with OLE drag'n'drop.
godeny wrote:How can i disable the context menu - for using my own context menu ?
Handle the ContextMenu event and set its showDefaultMenu parameter to False:

Code: Select all

Private Sub TextBox1_ContextMenu(ByVal button As Integer, ByVal shift As Integer, ByVal x As Single, ByVal y As Single, showDefaultMenu As Boolean)
  showDefaultMenu = False
  PopupMenu myMenu
End Sub
TiKu

Posted: 09 Apr 2008, 11:12
by godeny
The DragMode property comes from the VB runtime and not from my control. I think it can be used for dragging the control itself. At least it has nothing to do with OLE drag'n'drop.
I was asking this, because the normal VB controls have an OLEDragMode property, which can be set to Automatic. I'we thought, you have the same functionality, only the properties are different. (the VB controls have OLEDragMode and OLEDropMode, your control has only RegisterForOLEDragDrop).

If you Edit control does not have the automatic Drag mode, then this ATL 8.0 bug does not disturb me - then it is useless for me to set the DragMode . (i am using only OLE Drag and drop). And programming the manual OLEDrag is not a problem.

Zoltan

Re: ATL 8.0 + own context menu

Posted: 02 May 2008, 03:57
by TiKu
godeny wrote:when i set the DragMode property to 1 - vbAutomatic, then . when the Unicode Edit Control loosis the focus, the control disappears, and a text "ATL 8.0" will be displayed instead of the control.
I think I've finally fixed this one. :)