Print Page | Close Window

How can i get the position of buttom

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=21977
Printed Date: 27 April 2024 at 1:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How can i get the position of buttom
Posted By: csfishy
Subject: How can i get the position of buttom
Date Posted: 06 November 2013 at 2:48am
hello, i would like to ask a question, anybody can help me?

i can use ToolBar.GetWindowRect(... to get the toolbar position relative to screen,
but how can i get the position of single button control?

e.g.
Set Control = ToolBar.Controls.Find(xtpControlButton, ID_Tool_help, False, -1  )
how to get the "Control" position?



Replies:
Posted By: Micca
Date Posted: 23 April 2015 at 6:19am
How to get the absolute screen position of a toolbar control:

Dim L1 As Long, R1 As Long, T1 As Long, B1 As Long
Dim L2 As Long, R2 As Long, T2 As Long, B2 As Long
Dim ControlLeft as Long, ControlTop as Long

Control.Parent.GetWindowRect L1, T1, R1, B1
Control.GetRect L2, T2, R2, B2

ControlLeft = L1 + L2
ControlTop= T1 + T2


-------------
Micca

---------------------

Product: Xtreme Commandbars (ActiveX) Version 17.2

Platform: Win7 64bit

Language: Visual Basic 6.0 SP6



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