![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I recall reading somewhere about a function or property that returns the height of a window's title bar, but can't recall. Anyone know off the top of their head what that is? Thanks! |
#3
| |||
| |||
|
|
"Neil" <nospam (AT) nospam (DOT) net> wrote in message news:IRU2j.2342$C24.1420 (AT) newssvr17 (DOT) news.prodigy.net... I recall reading somewhere about a function or property that returns the height of a window's title bar, but can't recall. Anyone know off the top of their head what that is? Thanks! Declare Function GetSystemMetrics Lib "user32" Alias "GetSystemMetrics" _ (ByVal nIndex As Long) As Long Const SM_CYCAPTION = 4 BarHeight = GetSystemMetrics(SM_CYCAPTION) |
#4
| |||
| |||
|
|
"Neil" <nospam (AT) nospam (DOT) net> wrote in message news:IRU2j.2342$C24.1420 (AT) newssvr17 (DOT) news.prodigy.net... I recall reading somewhere about a function or property that returns the height of a window's title bar, but can't recall. Anyone know off the top of their head what that is? Thanks! Declare Function GetSystemMetrics Lib "user32" Alias "GetSystemMetrics" _ (ByVal nIndex As Long) As Long Const SM_CYCAPTION = 4 BarHeight = GetSystemMetrics(SM_CYCAPTION) |
#5
| |||
| |||
|
|
"Stuart McCall" <smccall (AT) myunrealbox (DOT) com> wrote in message news:fih75a$kqg$1$8302bc10 (AT) news (DOT) demon.co.uk... "Neil" <nospam (AT) nospam (DOT) net> wrote in message news:IRU2j.2342$C24.1420 (AT) newssvr17 (DOT) news.prodigy.net... I recall reading somewhere about a function or property that returns the height of a window's title bar, but can't recall. Anyone know off the top of their head what that is? Thanks! Declare Function GetSystemMetrics Lib "user32" Alias "GetSystemMetrics" _ (ByVal nIndex As Long) As Long Const SM_CYCAPTION = 4 BarHeight = GetSystemMetrics(SM_CYCAPTION) BTW, do you know which SM constant would give me the width of the window's left border? Thanks again. |
#6
| |||
| |||
|
|
"Neil" <nospam (AT) nospam (DOT) net> wrote in message news:V_X2j.3277$fl7.626 (AT) newssvr22 (DOT) news.prodigy.net... "Stuart McCall" <smccall (AT) myunrealbox (DOT) com> wrote in message news:fih75a$kqg$1$8302bc10 (AT) news (DOT) demon.co.uk... "Neil" <nospam (AT) nospam (DOT) net> wrote in message news:IRU2j.2342$C24.1420 (AT) newssvr17 (DOT) news.prodigy.net... I recall reading somewhere about a function or property that returns the height of a window's title bar, but can't recall. Anyone know off the top of their head what that is? Thanks! Declare Function GetSystemMetrics Lib "user32" Alias "GetSystemMetrics" _ (ByVal nIndex As Long) As Long Const SM_CYCAPTION = 4 BarHeight = GetSystemMetrics(SM_CYCAPTION) BTW, do you know which SM constant would give me the width of the window's left border? Thanks again. Sure. Here you go: Const SM_CXBORDER = 5 'Width of non-sizable borders Const SM_CYBORDER = 6 'Height of non-sizable borders Const SM_CXDLGFRAME = 7 'Width of dialog box borders Const SM_CYDLGFRAME = 8 'Height of dialog box borders As I recall, the sizeable window border is the same as SM_CXDLGFRAME, SM_CYDLGFRAME. I could be wrong, but I can't (right now) find the full api reference in order to check. |
#7
| |||
| |||
|
|
Thanks. Killing me, though, that I know I saw somewhere some property that gives you the x,y distances from the upper left corner of the window to the upper left corner of the form -- which would basically be the height of the title bar and the width of the border. |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Thanks. Killing me, though, that I know I saw somewhere some property that gives you the x,y distances from the upper left corner of the window to the upper left corner of the form -- which would basically be the height of the title bar and the width of the border. Ah. Maybe you could use: Forms!FormName.WindowHeight - Forms!FormName.InsideHeight The result will be in Twips. If you need it in Pixels, multiply by 15. Maybe that's what I saw. I remember reading somewhere there was a way to get |
#10
| |||
| |||
|
|
I'm curious (and there's no cure for curiosity). What do you need the info for? I'm opening up multiple instances of the same form. I want to place the |
![]() |
| Thread Tools | |
| Display Modes | |
| |