Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Top and Left of a Pane
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Top and Left of a Pane

 Post Reply Post Reply
Author
Message
allamore View Drop Down
Newbie
Newbie


Joined: 31 October 2006
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote allamore Quote  Post ReplyReply Direct Link To This Post Topic: Top and Left of a Pane
    Posted: 29 January 2008 at 12:32pm
Let me start out by describing the layout.

1) A VB6 form which has the docking pane manager
2) There is a grid inside of picture box
3) The picture box is assigned to a pane when we create the panes.

When the user clicks inside a cell of the grid, and the cell is a date/time cell, I need to show a datetime picker control over that cell.

I am having trouble finding the left and top values of the grids cell.

The grid always returns top/left of zero because it is inside the picture box control. The picturebox control also returns zero for top/left because it inside of the docking pane. So, the top level item is the docking pane. How can I get the top/left of that docking pane?

Adam Lamore
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 29 January 2008 at 1:15pm
Hi,
try use API function GetWIndowRect.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
allamore View Drop Down
Newbie
Newbie


Joined: 31 October 2006
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote allamore Quote  Post ReplyReply Direct Link To This Post Posted: 29 January 2008 at 2:58pm
'Get the current docking pane that we want the position for
Set dpTemp = dpTesting.FindPane(lPane_ID)
'Get the size information of the Docking Pane
GetWindowRect dpTemp.Handle, rectSize
'Put the top and Left into the a Point structure
pointapiTemp.X = rectSize.Left
pointapiTemp.Y = rectSize.Top
'Change the Docking Pane Coordinates to Screen Coordinates
ClientToScreen GetDesktopWindow, pointapiTemp
'Change the Screen Coordinates to the Form Coordinates
ScreenToClient frmRules.hwnd, pointapiTemp
'Change the Coordinates from Pixels to Twips, The form is is Twips
lLeft = ScaleX(pointapiTemp.X, vbPixels, Me.ScaleMode) + ScaleX(EditLeft, vbTwips, Me.ScaleMode)
lTop = ScaleY(pointapiTemp.Y, vbPixels, Me.ScaleMode) + ScaleY(EditTop, vbTwips, Me.ScaleMode)
dtpickerframe.Move lLeft, lTop, lColWidth, ScaleY((EditHeight), vbTwips, Me.ScaleMode) + 360

The date/time picker control is on the form. So the ScreenToClient api call is passed the forms hwnd value.

Adam
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.