15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Pulling hair over CComboBox sizing

Paul Roub -- proub@shadow.net
Thursday, August 29, 1996

Environment: Win 95, VC 4.2

I'm at the end of my rope... I've checked every FAQ I can get my hands
on, read the books, grepped the help files...  If this is still a
dumb question at this point, I humbly apologize.

I'm simply trying to properly size a CComboBox derivative.  At creation
time, I know the number and content of the strings within, I am
selecting a specific font and have a valid CDC to check extents, etc.

I'm just looking for that last little detail that will allow me to
figure out the precise proper dimensions for the box -- static,
drop-down list and all (I'm using CBS_DROPDOWNLIST, by the way).  Every 
time it seems I have it right under NT 3.51, it's too small under 95 or 
NT 4. (The height is the problem, widths are OK).

It seems like the right combination of GetTextMetrics, 
GetSystemMetric( SM_CYDLGFRAME ), etc. should give me the answer.
Anyone know the magic combination?


-paul

-- 
//	Paul Roub, Galacticomm Technical Operations
//	proub@gcomm.com
//	(954)583-5990



C. Zhang -- cz17309@goodnet.com
Saturday, August 31, 1996

Paul Roub wrote:
> 
> Environment: Win 95, VC 4.2
> 
> I'm at the end of my rope... I've checked every FAQ I can get my hands
> on, read the books, grepped the help files...  If this is still a
> dumb question at this point, I humbly apologize.
> 
> I'm simply trying to properly size a CComboBox derivative.  At creation
> time, I know the number and content of the strings within, I am
> selecting a specific font and have a valid CDC to check extents, etc.
> 
> I'm just looking for that last little detail that will allow me to
> figure out the precise proper dimensions for the box -- static,
> drop-down list and all (I'm using CBS_DROPDOWNLIST, by the way).  Every
> time it seems I have it right under NT 3.51, it's too small under 95 or
> NT 4. (The height is the problem, widths are OK).
> 
> It seems like the right combination of GetTextMetrics,
> GetSystemMetric( SM_CYDLGFRAME ), etc. should give me the answer.
> Anyone know the magic combination?
> 
> -paul
> 
> --
> //      Paul Roub, Galacticomm Technical Operations
> //      proub@gcomm.com
> //      (954)583-5990

The combo box in Win95 and NT 4 is displayed with 3D boarder. That is why 
it looks too small when it is just find in NT3.51. I would check the 
combo box size, and the old text metrix before changing its font and/or 
resizing it so that I could record the additional space which is needed 
under each environment. Then you can use that value to properly resize 
your combo box.



Dicky Singh -- Dicky@landmark.com
Tuesday, September 03, 1996

I don't have the right combination, but you may want to check SM_CYBORDER or 	SM_CYEDGE (and/or SM_CYDLGFRAME) also.

----------
From: 	Paul Roub[SMTP:proub@shadow.net]
Sent: 	Thursday, August 29, 1996 9:35 a
To: 	mfc-l@netcom.com
Subject: 	Pulling hair over CComboBox sizing

Environment: Win 95, VC 4.2

I'm at the end of my rope... I've checked every FAQ I can get my hands
on, read the books, grepped the help files...  If this is still a
dumb question at this point, I humbly apologize.

I'm simply trying to properly size a CComboBox derivative.  At creation
time, I know the number and content of the strings within, I am
selecting a specific font and have a valid CDC to check extents, etc.

I'm just looking for that last little detail that will allow me to
figure out the precise proper dimensions for the box -- static,
drop-down list and all (I'm using CBS_DROPDOWNLIST, by the way).  Every 
time it seems I have it right under NT 3.51, it's too small under 95 or 
NT 4. (The height is the problem, widths are OK).

It seems like the right combination of GetTextMetrics, 
GetSystemMetric( SM_CYDLGFRAME ), etc. should give me the answer.
Anyone know the magic combination?


-paul

-- 
//	Paul Roub, Galacticomm Technical Operations
//	proub@gcomm.com
//	(954)583-5990



--------------------
Dicky Singh, Dicky@Landmark.COM
Dragon Team. Landmark Systems Inc.
8000 Towers Crescent, Vienna VA 22182




| Вернуться в корень Архива |