Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Form titlebar height

Hi

I'm using Excel to build a custom application, and use a
class module to muck around with forms to do things such
as remove/resize the titlebar, remove the maximize
button, etc. (it is based upon one I downloaded from one
of the Excel MVP sites).

My problem is that when I remove the titlebar of a form,
the form height remains the same, so that it doesn't
display as designed (i.e. with an extra bit at the
bottom). Yes, I adjust the height in code by a fixed
amount, but that only works cleanly on my OS display
settings (XP style). If my app runs on Windows 2000
(with the shorter titlebars), the form heights are not
adjusted properly.

So, I need to know which windows .dll to use (and how) to
determine the user's titlebar height setting in twips (or
whatever measurement scale Excel VBA uses for form
heights). I guess it's user32.dll with GetSystemMetrics
(maybe!), but which item number is it?

Hope that makes some sense to somebody!

Many thanks, Phillip
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Form titlebar height

Hi Phillip;
The title bar is a skin; if you remove the title bar, you must change
dimensions of the window consequently.
hCaption = Me.Height - Me.InsideHeight - ((Me.Width - Me.InsideWidth) / 2)
Me.Height = Me.Height - hCaption

MP

"Phillip Reeves" a écrit dans le message de
...
Hi

I'm using Excel to build a custom application, and use a
class module to muck around with forms to do things such
as remove/resize the titlebar, remove the maximize
button, etc. (it is based upon one I downloaded from one
of the Excel MVP sites).

My problem is that when I remove the titlebar of a form,
the form height remains the same, so that it doesn't
display as designed (i.e. with an extra bit at the
bottom). Yes, I adjust the height in code by a fixed
amount, but that only works cleanly on my OS display
settings (XP style). If my app runs on Windows 2000
(with the shorter titlebars), the form heights are not
adjusted properly.

So, I need to know which windows .dll to use (and how) to
determine the user's titlebar height setting in twips (or
whatever measurement scale Excel VBA uses for form
heights). I guess it's user32.dll with GetSystemMetrics
(maybe!), but which item number is it?

Hope that makes some sense to somebody!

Many thanks, Phillip



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Form titlebar height

Hi Michel,

Thank you so much for your prompt solution! I've been
trying to sort that out for ages...

I had to reduce the value of hCaption by 2.5 to get the
forms to appear precisely the same regardless of Windows
titlebar heights, but it works wonderfully now.

Thanks again,

Phillip


-----Original Message-----
Hi Phillip;
The title bar is a skin; if you remove the title bar,

you must change
dimensions of the window consequently.
hCaption = Me.Height - Me.InsideHeight - ((Me.Width -

Me.InsideWidth) / 2)
Me.Height = Me.Height - hCaption

MP

"Phillip Reeves" a écrit

dans le message de
...
Hi

I'm using Excel to build a custom application, and use

a
class module to muck around with forms to do things

such
as remove/resize the titlebar, remove the maximize
button, etc. (it is based upon one I downloaded from

one
of the Excel MVP sites).

My problem is that when I remove the titlebar of a

form,
the form height remains the same, so that it doesn't
display as designed (i.e. with an extra bit at the
bottom). Yes, I adjust the height in code by a fixed
amount, but that only works cleanly on my OS display
settings (XP style). If my app runs on Windows 2000
(with the shorter titlebars), the form heights are not
adjusted properly.

So, I need to know which windows .dll to use (and how)

to
determine the user's titlebar height setting in twips

(or
whatever measurement scale Excel VBA uses for form
heights). I guess it's user32.dll with

GetSystemMetrics
(maybe!), but which item number is it?

Hope that makes some sense to somebody!

Many thanks, Phillip



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Form titlebar height

Hi Phillip;
If your window does not have a framework, hCaption = Me.Height -
Me.InsideHeight.
2.5 is about the width of the framework.
MP

"Phillip Reeves" a écrit dans le message de
...
Hi Michel,

Thank you so much for your prompt solution! I've been
trying to sort that out for ages...

I had to reduce the value of hCaption by 2.5 to get the
forms to appear precisely the same regardless of Windows
titlebar heights, but it works wonderfully now.

Thanks again,

Phillip


-----Original Message-----
Hi Phillip;
The title bar is a skin; if you remove the title bar,

you must change
dimensions of the window consequently.
hCaption = Me.Height - Me.InsideHeight - ((Me.Width -

Me.InsideWidth) / 2)
Me.Height = Me.Height - hCaption

MP

"Phillip Reeves" a écrit

dans le message de
...
Hi

I'm using Excel to build a custom application, and use

a
class module to muck around with forms to do things

such
as remove/resize the titlebar, remove the maximize
button, etc. (it is based upon one I downloaded from

one
of the Excel MVP sites).

My problem is that when I remove the titlebar of a

form,
the form height remains the same, so that it doesn't
display as designed (i.e. with an extra bit at the
bottom). Yes, I adjust the height in code by a fixed
amount, but that only works cleanly on my OS display
settings (XP style). If my app runs on Windows 2000
(with the shorter titlebars), the form heights are not
adjusted properly.

So, I need to know which windows .dll to use (and how)

to
determine the user's titlebar height setting in twips

(or
whatever measurement scale Excel VBA uses for form
heights). I guess it's user32.dll with

GetSystemMetrics
(maybe!), but which item number is it?

Hope that makes some sense to somebody!

Many thanks, Phillip



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I autofit row height to adjust to new text on Excel form? kbear34 Excel Discussion (Misc queries) 1 February 17th 10 05:32 PM
Workbook_open : Putting in message in titlebar (Visual Basic) Jorgen [DK/2600] Excel Worksheet Functions 4 May 20th 06 04:20 PM
What is [Group] in the titlebar of an Excel spreadsheet? dv123 Excel Discussion (Misc queries) 1 January 29th 06 07:27 PM
Full Pathname in Titlebar Greg Setting up and Configuration of Excel 3 March 25th 05 01:49 AM
userform titlebar and closing form D.S.[_3_] Excel Programming 6 November 29th 03 06:26 PM


All times are GMT +1. The time now is 03:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"