Solved

Drag/Drop on CTabCtrl?

Posted on 2000-03-17
3
648 Views
Last Modified: 2013-11-20
Hi,

A friend of mine is using a class derived from the CTabCtrl and wants to add drag and drop to it. The problem he gets with drag and drop is that he only can drop on the tab area of the control and not on the client area. The new class has not changed any parts that can be important for this. I have a problem verifying any request since the code isn't mine, so please only answer if you have a good suggestion regarding this topic.

I.E How can he get the client area of the tab control to accept drops?

/ Andreas
0
Comment
Question by:cost
  • 2
3 Comments
 
LVL 5

Expert Comment

by:vachooho
ID: 2629183
probably there is other window in tab ctrl's client area.

YOu need to register drop target for that window too!

0
 

Author Comment

by:cost
ID: 2631441
That I already understood, but since I can't find a way to get to that window I don't know what to do. I suggested to my friend to use CWnd::GetWindow(GW_CHILD), but he says it doesn't work
0
 
LVL 5

Accepted Solution

by:
vachooho earned 300 total points
ID: 2631667
try
CRect rect;
CTabCtrl::GetWindowRect(&rect);
CTabCtrl::AdjustRect(FALSE, &rect);
CPoint point(rect.left, rect.top);
point.Offset(rect.Width()/2, rect.Height()/2);
Wndn * pChild = CWnd::WindowFromPoint(point);
if(pChild != NULL)
{
   //register it as drop target
}

0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 49
has77  challenge 9 85
Window placement 17 83
Unix Command -- Challenging  question 7 92
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question