Print Page | Close Window

Top and Left of a Pane

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=9439
Printed Date: 10 June 2024 at 2:03am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Top and Left of a Pane
Posted By: allamore
Subject: Top and Left of a Pane
Date 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



Replies:
Posted By: Oleg
Date Posted: 29 January 2008 at 1:15pm
Hi,
try use API function GetWIndowRect.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: allamore
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net