en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en nl en en en en nl en en en en en en en en en nl uk en de it en en en en nl en en en en en en en en nl en en en en nl en en en en en pt en nl uk en en en fr en en en en nl en en en en en en en en en en de en en en en nl en en en en en en en en en en en en en nl en en tr en en en en nl en en en en nl vi en en en en en en en en en nl uk en en en en en de en en en fr en en en en en en en en en pt en en en en en en
By logging into your account, you agree to our Privacy Policy, personal data processing and storage practices as described therein.
Forgot password or user name?
Search in titles only Search in PowerBASIC for Windows only
You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Width of a scroll bar
All Time Today Last Week Last Month
All Discussions only Photos only Videos only Links only Polls only Events only
Width of a scroll bar
2 Apr 2001, 12:24 AM
When designing dialogs I'm using GetTextExtentPoint32, in order to retrieve correct values for cx and cy.
For listboxes and edit controls there is one minor unsolved matter: when those controls have a vertical scroll bar, text sometimes disappears behind that bar. What is the number of du's to take in account for the expected width of a scroll bar?
Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
*** Opinions expressed here are not necessarily untrue ***
Join Date: Mar 2001
2 Apr 2001, 12:54 AM
Get the width of a vertical scroll bar by using GetSystemMetrics( %SM_CXVSCROLL ) - this will give you the width in pixels. Then you can use GetDialogBaseUnits to convert it to DUs.
[This message has been edited by Aldo Cavini (edited April 02, 2001).]
Join Date: Mar 1999
2 Apr 2001, 01:07 AM
I have to know such standard API things, but sometimes I'm worse than my laptop: 'out of memory'. Let's assume it is my age.
Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
*** Opinions expressed here are not necessarily untrue ***
Join Date: Sep 1999
2 Apr 2001, 01:29 AM
The GetDialogBaseUnits function retrieves the system's dialog base units, which are the average width and height of characters in the system font.
For dialog boxes that do not use the system font (DDT), the conversion from dialog template units to pixels depends on the font used by the dialog box.
This means that it's necessary ro use MapDialogRect. Almost sure that PB Dialog Pixels to Units uses exactly this function.
Join Date: Jan 2000
2 Apr 2001, 02:28 AM
GetClientRect returns size minus scrollbars, if such exist. See:
'¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ' Template '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ #COMPILE EXE #INCLUDE "WIN32API.INC" '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ' Create dialog and controls, etc '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ FUNCTION PBMAIN () AS LONG LOCAL hDlg AS LONG, rc AS RECT, rc2 AS RECT DIALOG NEW 0, "Test",,, 180, 115, %DS_MODALFRAME OR %WS_CAPTION OR %WS_SYSMENU, 0 TO hDlg CONTROL ADD TEXTBOX, hDlg, 10, "", 4, 4, 172, 50, %WS_CHILD OR _ %ES_MULTILINE OR %WS_VSCROLL, %WS_EX_CLIENTEDGE CONTROL ADD TEXTBOX, hDlg, 11, "", 4, 60, 172, 50, %WS_CHILD OR _ %ES_MULTILINE, %WS_EX_CLIENTEDGE GetClientRect GetDlgItem(hDlg, 10), rc GetClientRect GetDlgItem(hDlg, 11), rc2 CONTROL SET TEXT hDlg, 10, "ClientWidth:" & STR$(rc.nRight) CONTROL SET TEXT hDlg, 11, "ClientWidth:" & STR$(rc2.nRight) DIALOG SHOW MODAL hDlg END FUNCTION
Join Date: Jun 2000
2 Apr 2001, 03:02 AM
Join Date: Mar 1999
2 Apr 2001, 03:37 AM
Thanks for all your help, but.....
I don't need the client width of a created listbox, edit control or whatsoever.
What I am after is the expected width of a scroll bar, in order to create a control with sufficient space for both, text and the scrollbar..
In that respect Aldo already gave me the answer I need.
Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
*** Opinions expressed here are not necessarily untrue ***
Copyright © 1998-2022 PowerBASIC Tools, LLC - All Rights Reserved.
Powered by vBulletin® Version 5.7.0
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
All times are GMT-5. This page was generated at 11:02 PM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.