Top and Left of a Pane |
Post Reply |
Author | |
allamore
Newbie Joined: 31 October 2006 Location: United States Status: Offline Points: 3 |
Post Options
Thanks(0)
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 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
try use API function GetWIndowRect.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
allamore
Newbie Joined: 31 October 2006 Location: United States Status: Offline Points: 3 |
Post Options
Thanks(0)
|
'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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |