When you add a status panel to a form, it also adds a size grip to the bottom right hand corner of the form.
Is there a way to get this size grip without using a status bar?
Printable View
When you add a status panel to a form, it also adds a size grip to the bottom right hand corner of the form.
Is there a way to get this size grip without using a status bar?
Quote:
Originally Posted by SeanK
Take a look at this post by Brian Hawley he came up with a thing he calls a "Shangle". Give it a try.
That attachment link by Brian Hawley doesn't seem to be working. Here is some code that I have that I don't remember where I got, but I've used it a ton of times.
Add a label to the form. Call it lblSizeGrip. In design, set the font to Marlett, the font style to Bold, the font size to 12, the mousepointer to 8 (Size NW SE), the caption to "p", the forecolor to &H00404040&, the alignment to center, and the backstyle to transparent. Size the label as small as possible.
VB Code:
Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" _ (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As Long Private Declare Sub ReleaseCapture Lib "User32" () Private Const WM_NCLBUTTONDOWN = &HA1 Private Const HTBOTTOMRIGHT = 17 Private Sub Form_Resize() 'position label in bottom right hand corner lblSizeGrip.Move Me.ScaleWidth - lblSizeGrip.Width, Me.ScaleHeight - lblSizeGrip.Height End Sub Private Sub lblSizeGrip_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage hwnd, WM_NCLBUTTONDOWN, HTBOTTOMRIGHT, ByVal 0& End Sub
Here's a couple classes I wrote. uses the API to draw themed and unthemed grips...
CSizeGrip.cls Attachment 128657
CSizeGripLR.cls Attachment 128659
several caviats... but probably the most important is that It automatically sets your form scalemode to pixels, and I don't think I ever rewote a version of this class to compensate for other scalemodes.Code:Dim grip as New CSizeGrip
Private Sub Form_Load()
grip.Attach Me
End Sub
Somewhere I have a version that optionally uses the Marlett font method on the bottom left, used for resizing custom drop down lists like in Visual Studio's properties grid too if you need that.
I'll try them, thanks.