dbTalk Databases Forums  

Height of Title Bar

comp.databases.ms-access comp.databases.ms-access


Discuss Height of Title Bar in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Neil
 
Posts: n/a

Default Height of Title Bar - 11-27-2007 , 07:20 AM






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!



Reply With Quote
  #2  
Old   
Stuart McCall
 
Posts: n/a

Default Re: Height of Title Bar - 11-27-2007 , 07:46 AM






"Neil" <nospam (AT) nospam (DOT) net> wrote

Quote:
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)




Reply With Quote
  #3  
Old   
Neil
 
Posts: n/a

Default Re: Height of Title Bar - 11-27-2007 , 09:40 AM




"Stuart McCall" <smccall (AT) myunrealbox (DOT) com> wrote

Quote:
"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)

OK, thanks. For some reason I thought I had seen a built-in function or
property in the Access help. Thanks.




Reply With Quote
  #4  
Old   
Neil
 
Posts: n/a

Default Re: Height of Title Bar - 11-27-2007 , 10:55 AM




"Stuart McCall" <smccall (AT) myunrealbox (DOT) com> wrote

Quote:
"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.




Reply With Quote
  #5  
Old   
Stuart McCall
 
Posts: n/a

Default Re: Height of Title Bar - 11-27-2007 , 12:00 PM



"Neil" <nospam (AT) nospam (DOT) net> wrote

Quote:
"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.






Reply With Quote
  #6  
Old   
Neil
 
Posts: n/a

Default Re: Height of Title Bar - 11-27-2007 , 12:52 PM




"Stuart McCall" <smccall (AT) myunrealbox (DOT) com> wrote

Quote:
"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.




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.




Reply With Quote
  #7  
Old   
Stuart McCall
 
Posts: n/a

Default Re: Height of Title Bar - 11-27-2007 , 05:19 PM



Quote:
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.




Reply With Quote
  #8  
Old   
Stuart McCall
 
Posts: n/a

Default Re: Height of Title Bar - 11-27-2007 , 05:48 PM



I'm curious (and there's no cure for curiosity). What do you need the info
for?



Reply With Quote
  #9  
Old   
Neil
 
Posts: n/a

Default Re: Height of Title Bar - 11-27-2007 , 05:59 PM




"Stuart McCall" <smccall (AT) myunrealbox (DOT) com> wrote

Quote:
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
the titlebar height directly with Access properties. That looks like what I
may have read. Thanks.




Reply With Quote
  #10  
Old   
Neil
 
Posts: n/a

Default Re: Height of Title Bar - 11-27-2007 , 06:01 PM




"Stuart McCall" <smccall (AT) myunrealbox (DOT) com> wrote

Quote:
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
second instance just a little down from the first, so the top left corner of
the window sits right at the top left of the form in the previous window,
and so on.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.