Tear off tabs

  • Thread starter Thread starter Marty Honea
  • Start date Start date
M

Marty Honea

I'm looking for a code example to show me how to implement Tear Off Tabs in
a form I'm designing. And before anyone says GIYF, I've googled it in just
about every form I can think of, but come up with C++ code to mimick C#
functionality.

Learning a new language is a PITA some times. After years of working with
the other language, I'm familiar with most functionality and if I don't
recall just how to do it, I have a code library built up that I can usually
remember where I did it before. It's going to take years to get to that
point in C#.

Marty
 
Ok, maybe I can get some help to take this in smaller steps...

I've gotten the hit info for the correct tab, and I can hide the tab... But
I only want to do so if I've drug it outside of the current frame.

Can anyone tell me how to know that I've drug something outside of the
frame?

Marty Honea
 
Ok, I found the event MouseLeave...

But it's not triggered if the MouseButton.Left is pressed when the cursor
leaves the form. It doesn't trigger until you pull the cursor back into the
form.

It is triggered for the tab with the MouseButton.Left pressed, but then I
end up with premature detachment. <G>

I don't want the code triggered if the tab is drug to the center of the
form, only if it's drug outside the form.

Any suggestions?

Marty
 
Sometimes you can't see the forrest for the trees...


It occured to me to take a look at MouseUp...

And for anyone who's learning and wondering how to do this....

Just look to see if your mouse is outside the frame when you mouse up.
private void xtraTabControl1_MouseUp(object sender, MouseEventArgs e)

{

if (xtraTabControl1.SelectedTabPage == null) return;

if (!this.ClientRectangle.Contains(new Point(e.X, e.Y)))

{

xtraTabControl1.SelectedTabPage.PageVisible = false;

};

}
 
Back
Top