Is there a simple way to make NxPanels sizeable at runtime?
I tried MouseMove/MouseDown to catch the edges and force a resize, but for some reason the MouseMove procedure seems unable to flag the edges.. Any Suggestions?
Here is what I was trying:
procedure TForm1.NxPanMainMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); const SC_SIZELEFT = 1; SC_SIZERIGHT = 2; SC_SIZETOP = 3; SC_SIZEBOTTOM = 6; var Corner: TRectCorner; MsgCode: Integer; begin Corner:=GetRectCorner(NxPanMain.BoundsRect, ScreenToClient(NxPanMain.ClientToScreen(Point(X,Y)))) ; if Corner<>rcClient then begin SetCursor(Screen.Cursors[ RectCornerToSizeCursor( GetRectCorner(NxPanMain.BoundsRect, ScreenToClient(NxPanMain.ClientToScreen(Point(X,Y)))),Cursor)]); MsgCode:=SC_SIZE; if Corner in [rcTopLeft,rcLeft,rcBottomLeft] then Inc(MsgCode,SC_SIZELEFT) else if Corner in [rcTopRight,rcRight,rcBottomRight] then Inc(MsgCode,SC_SIZERIGHT); if Corner in [rcTopLeft,rcTop,rcTopRight] then Inc(MsgCode,SC_SIZETOP) else if Corner in [rcBottomLeft,rcBottom,rcBottomRight] then Inc(MsgCode,SC_SIZEBOTTOM); ReleaseCapture; SendMessage(NxPanMain.Handle,WM_SYSCOMMAND,MsgCode,0) ; end; end; procedure TForm1.NxPanMainMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin SetCursor(Screen.Cursors[ RectCornerToSizeCursor( GetRectCorner(NxPanMain.BoundsRect, ScreenToClient(NxPanMain.ClientToScreen(Point(X,Y)))),Cursor)]); end;