Article View: borland.public.cppbuilder.nativeapi
Article #14901Change StringGrid's scroll bar width
From: Paul Dadah
Date: Fri, 25 Jul 2003 21:23
Date: Fri, 25 Jul 2003 21:23
77 lines
2867 bytes
2867 bytes
I am using XP and BCB5.
With help from these newsgroups I can increase the StringGrid's scrollbar
width. This works great except that my icons on the taskbar also increase in
size. When I change the size back the icons do not return to there original
size. But if I reboot they are back to their original size. I would like to
either prevent the icons from changeing or change them back. Thanks for your
help.
Here is my code:
__fastcall TFormOrderViewer::TFormOrderViewer(TComponent* Owner)
: TForm(Owner)
{
NONCLIENTMETRICS gs_info = {0};
int gs;
gs_info.cbSize = sizeof(NONCLIENTMETRICS);
gs = SystemParametersInfo(
SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS),
&gs_info,
0);
if (! gs)
{
ShowMessage("can't get system info for Scrollbar.");
}
Old_ScrollBar_Size = gs_info.iScrollWidth;
gs_info.iScrollWidth = 35;
gs = SystemParametersInfo(
SPI_SETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS),
&gs_info,
0);
if (gs == false)
{
ShowMessage("can't set system info for Scrollbar.");
}
}
//return the width to the original setting with the following code:
void __fastcall TFormOrderViewer::FormClose(TObject *Sender,
TCloseAction &Action)
{
NONCLIENTMETRICS gs_info = {0};
int gs;
gs_info.cbSize = sizeof(NONCLIENTMETRICS);
gs = SystemParametersInfo(
SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS),
&gs_info,
0);
if (! gs)
{
ShowMessage("can't get system info for Scrollbar.");
}
gs_info.iScrollWidth = Old_ScrollBar_Size;
gs = SystemParametersInfo(
SPI_SETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS),
&gs_info,
0);
if (gs == false)
{
ShowMessage("can't set system info for Scrollbar.");
}
}
Technical Details
Message-ID:
<3f219fc6@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c27c3eb7b8cf8fd3,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-25 14:39:45 PST From: "Paul Dadah" <paulyzxNOSPAM@rushmore.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Change StringGrid's scroll bar width Date: Fri, 25 Jul 2003 15:23:10 -0600 Lines: 79 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 148.63.78.236 Message-ID: <3f219fc6@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1059168198 148.63.78.236 (25 Jul 2003 14:23:18 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail