Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

OnDragEnter doesn't fire on empty TabControl

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Francois Vanderseypen - 22 Dec 2004 10:50 GMT
Can someone tell me why you cannot drag something onto a tabcontrol
with zero tabpages? I have a kind of 'docking' interface and relies
heavily on GDI+, a screenshot is available here:

http://netron.sourceforge.net/Biotron3Shot.jpg

You can move tab pages in the different panes, unless it's totally
empty (TabCount=0). Is there an alternative?

Thanks a lot,
Swa

[The Netron Project, http://netron.sf.net]
Alan - 22 Dec 2004 11:09 GMT
Hello Swa,
About the TabControl in MSDN document, the description you can see is below:
 Note   The following events are not raised for the TabControl class unless
there is at least one TabPage in the TabControl.TabPages collection:
Control.Click, Control.DoubleClick, Control.MouseDown, Control.MouseUp,
Control.MouseHover, Control.MouseEnter, Control.MouseLeave and
Control.MouseMove. If there is at least one TabPage in the collection, and
the user interacts with the tab control's header (where the TabPage names
appear), the TabControl raises the appropriate event. However, if the user
interaction is within the ClientRectangle of the tab page, the TabPage
raises the appropriate event.
"Francois Vanderseypen" <netronproject@hotmail.com>
??????:40309dc.0412220252.868be27@posting.google.com...
> Can someone tell me why you cannot drag something onto a tabcontrol
> with zero tabpages? I have a kind of 'docking' interface and relies
[quoted text clipped - 9 lines]
>
> [The Netron Project, http://netron.sf.net]
Mick Doherty - 22 Dec 2004 18:10 GMT
The TabControl is all Non-Client Area.
WM_NCHITTEST returns HTTRANSPARENT when there is no Tab in the area under
the mouse, so the Tabcontrol does not receive these Mouse events. They are
passed to the underlying control.

To test this just add an eventhandler for Form.Click (assuming the form is
the tabcontrols container) and you will find it fires when you click on the
TabControl.

I haven't tested it, but I would think you can do your dragdrop on the form
(or what ever control is the tabcontrols container) and test whether the
drop point is within the bounds of the tabcontrol.

Signature

Mick Doherty
http://dotnetrix.co.uk/nothing.html

> Can someone tell me why you cannot drag something onto a tabcontrol
> with zero tabpages? I have a kind of 'docking' interface and relies
[quoted text clipped - 9 lines]
>
> [The Netron Project, http://netron.sf.net]

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.