How do you get the grabber icon on a toolbars?
-
How does one get the little grabber at the extreme left of a ToolBar to show? I'm designing dockable toolbars that can also be moved by the user and that visual clue would be a nice touch. Thanks! -- modified at 19:53 Wednesday 30th November, 2005
-
How does one get the little grabber at the extreme left of a ToolBar to show? I'm designing dockable toolbars that can also be moved by the user and that visual clue would be a nice touch. Thanks! -- modified at 19:53 Wednesday 30th November, 2005
You have to draw this yourself. Here is some sample code to do this:
Win32Lib.RECT rc = new Win32Lib.Rect(); rc.left = this.Left; rc.right = this.Left + this.Width; rc.bottom = this.Top + this.Height; rc.top = this.Top; if(DockStyle != DockStyle.Right && DockStyle != DockStyle.Left) { rc.left = 1; rc.right = 1 + 3; } else { rc.top = 1; rc.bottom = 1 + 3; } Win32Lib.DrawEdge( hDC, ref rc, Win32Lib.BDR_RAISEDINNER, Win32Lib.BF_RECT );
Note that this calls the Windows API using Interop to do this. This gives you the gripper that you see in VC++ 6.0, There are other ways to do this, this is just an example. Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons -
You have to draw this yourself. Here is some sample code to do this:
Win32Lib.RECT rc = new Win32Lib.Rect(); rc.left = this.Left; rc.right = this.Left + this.Width; rc.bottom = this.Top + this.Height; rc.top = this.Top; if(DockStyle != DockStyle.Right && DockStyle != DockStyle.Left) { rc.left = 1; rc.right = 1 + 3; } else { rc.top = 1; rc.bottom = 1 + 3; } Win32Lib.DrawEdge( hDC, ref rc, Win32Lib.BDR_RAISEDINNER, Win32Lib.BF_RECT );
Note that this calls the Windows API using Interop to do this. This gives you the gripper that you see in VC++ 6.0, There are other ways to do this, this is just an example. Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter GibbonsThanks for your reply, Andy. Does this require additional references? I don't see the Win32Lib in Visual C#. I'm using VS 2003, FYI. What other ways would you suggest to get the gripper?
-
Thanks for your reply, Andy. Does this require additional references? I don't see the Win32Lib in Visual C#. I'm using VS 2003, FYI. What other ways would you suggest to get the gripper?
This is a wrapper library around the Win32 API that I created. I am using interop to make calls to the native API. This like on MSDN tells you about this function. You have to use DllImport and define the appropriate constants in your own code. If you are not sure how to interop with native libraries there are lots of articles here that explain this. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_6aat.asp[^] I hope this helps. Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons