Welcome to dbFreaks.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Scroll Bars

 
   Database Help (Home) -> Visual Basic RSS
Related Topics:
sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table and there a column wich is data type All data in this column is in form So why when i run .asp page with simple query to..

arrays - is there a way to the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a for example after 5 records printed. Thank you all

Possible Use of a Cursor - I have a complex query that I hope I can explain it well enough for everyone to I have a table that contains for work Contained in the table are these are groupings of machining

Can I Update entire record in SQL ? - Heya, I am working on making a SQL database an exact mirror of a local Access database. I check the .mdb database every few minutes for new entries, if there are new entries, I retrieve them and write them to an exact replica table in SQL. This all works
Next:  Visual Basic: Possible Use of a Cursor  
Author Message
oinzea

External


Since: Jan 30, 2005
Posts: 2



(Msg. 1) Posted: Tue Feb 22, 2005 11:40 am
Post subject: Scroll Bars
Archived from groups: comp>lang>basic>visual>database, others (more info?)

Is there a way to find the size of scrollbars on a system using Visual Basic
6.0?

I know how to look and change them on the display properties, but I don't
know how to access that information from within Visual Basic.

 >> Stay informed about: Scroll Bars 
Back to top
Login to vote
Martin Trump

External


Since: Feb 22, 2005
Posts: 1



(Msg. 2) Posted: Tue Feb 22, 2005 12:40 pm
Post subject: Re: Scroll Bars [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In message <b1c02$421b544b$4117f14d$15166@ispnews.usenetserver.com>, Oin
Zea <OinZea.TakeThisOut@hotmail.com> writes
 >Is there a way to find the size of scrollbars on a system using Visual
 >Basic 6.0?

In VB6, a new .exe. Add a scrollbar, click on it and hit your good
friend F1 and look at Properties. HTH.

Regards
--
Martin Trump<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Scroll Bars 
Back to top
Login to vote
Rick Rothstein

External


Since: Nov 06, 2003
Posts: 9



(Msg. 3) Posted: Tue Feb 22, 2005 12:40 pm
Post subject: Re: Scroll Bars [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > Is there a way to find the size of scrollbars on a system using Visual
Basic
 > 6.0?
 >
 > I know how to look and change them on the display properties, but I
don't
 > know how to access that information from within Visual Basic.

Take your pick... there appears to be three constant arguments that all
return the same value (see the Form_Load event code); the remaining
constants are shown for completeness.

Rick - MVP

Private Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long

Const SM_CXSCREEN = 0 'X Size of screen
Const SM_CYSCREEN = 1 'Y Size of Screen
Const SM_CXVSCROLL = 2 'X Size of arrow in vertical scroll bar.
Const SM_CYHSCROLL = 3 'Y Size of arrow in horizontal scroll bar
Const SM_CYCAPTION = 4 'Height of windows caption
Const SM_CXBORDER = 5 'Width of no-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
Const SM_CYVTHUMB = 9 'Height of scroll box on horizontal scroll bar
Const SM_CXHTHUMB = 10 ' Width of scroll box on horizontal scroll bar
Const SM_CXICON = 11 'Width of standard icon
Const SM_CYICON = 12 'Height of standard icon
Const SM_CXCURSOR = 13 'Width of standard cursor
Const SM_CYCURSOR = 14 'Height of standard cursor
Const SM_CYMENU = 15 'Height of menu
Const SM_CXFULLSCREEN = 16 'Width of client area of maximized window
Const SM_CYFULLSCREEN = 17 'Height of client area of maximized window
Const SM_CYKANJIWINDOW = 18 'Height of Kanji window
Const SM_MOUSEPRESENT = 19 'True is a mouse is present
Const SM_CYVSCROLL = 20 'Height of arrow in vertical scroll bar
Const SM_CXHSCROLL = 21 'Width of arrow in vertical scroll bar
Const SM_DEBUG = 22 'True if deugging version of windows is running
Const SM_SWAPBUTTON = 23 'True if left and right buttons are swapped.
Const SM_CXMIN = 28 'Minimum width of window
Const SM_CYMIN = 29 'Minimum height of window
Const SM_CXSIZE = 30 'Width of title bar bitmaps
Const SM_CYSIZE = 31 'height of title bar bitmaps
Const SM_CXMINTRACK = 34 'Minimum tracking width of window
Const SM_CYMINTRACK = 35 'Minimum tracking height of window
Const SM_CXDOUBLECLK = 36 'double click width
Const SM_CYDOUBLECLK = 37 'double click height
Const SM_CXICONSPACING = 38 'width between desktop icons
Const SM_CYICONSPACING = 39 'height between desktop icons
Const SM_MENUDROPALIGNMENT = 40 'Zero if popup menus are aligned
'to the left of the memu bar item.
'True if it is aligned to the right.
Const SM_PENWINDOWS = 41 'The handle of the pen windows DLL if loaded.
Const SM_DBCSENABLED = 42 'True if double byte characteds are enabled
Const SM_CMOUSEBUTTONS = 43 'Number of mouse buttons.
Const SM_CMETRICS = 44 'Number of system metrics
Const SM_CLEANBOOT = 67 'Windows 95 boot mode.
'0 = normal, 1 = safe, 2 = safe with network
Const SM_CXMAXIMIZED = 61 'default width of win95 maximised window
Const SM_CXMAXTRACK = 59 'maximum width when resizing win95 windows
Const SM_CXMENUCHECK = 71 'width of menu checkmark bitmap
Const SM_CXMENUSIZE = 54 'width of button on menu bar
Const SM_CXMINIMIZED = 57 'width of rectangle into which minimised
'windows must fit.
Const SM_CYMAXIMIZED = 62 'default height of win95 maximised window
Const SM_CYMAXTRACK = 60 'maximum width when resizing win95 windows
Const SM_CYMENUCHECK = 72 'height of menu checkmark bitmap
Const SM_CYMENUSIZE = 55 'height of button on menu bar
Const SM_CYMINIMIZED = 58 'height of rectangle into which minimised
'windows must fit.
Const SM_CYSMCAPTION = 51 'height of windows 95 small caption
Const SM_MIDEASTENABLED = 74 'Hebrw and Arabic enabled for windows 95
Const SM_NETWORK = 63 'bit o is set if a network is present.
'Const SM_SECURE = 44 'True if security is present
'on windows 95 system
Const SM_SLOWMACHINE = 73 'true if machine is too slow to run win95.

Private Sub Form_Load()
'KPD-Team 1998
'URL: <a style='text-decoration: underline;' href="http://www.allapi.net/" target="_blank">http://www.allapi.net/</a>
'E-Mail: KPDTeam RemoveThis @Allapi.net
'Set the graphic mode to persistent
Me.AutoRedraw = True
'retrieve information and print it to the form
Me.Print "Width of arrow in vertical scroll bar:" & _
Str$(GetSystemMetrics(SM_CXHSCROLL))
Me.Print "Width of scroll box on horizontal scroll bar:" & _
Str$(GetSystemMetrics(SM_CXHTHUMB))
Me.Print "X Size of arrow in vertical scroll bar:" & _
Str$(GetSystemMetrics(SM_CXVSCROLL))
End Sub<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Scroll Bars 
Back to top
Login to vote
Rick Rothstein

External


Since: Nov 06, 2003
Posts: 9



(Msg. 4) Posted: Tue Feb 22, 2005 1:21 pm
Post subject: Re: Scroll Bars [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

  > >Is there a way to find the size of scrollbars on a system using
Visual
  > >Basic 6.0?
 >
 > In VB6, a new .exe. Add a scrollbar, click on it and hit your good
 > friend F1 and look at Properties. HTH.

I assumed the OP wanted to find the size of scrollbars that appear
within "windows" or controls. While your (implied) suggestion to use a
ScrollBar control to get this size would work on the developer's system,
I don't think that it would work on someone else's system. Since the
ScrollBar comes with a Width property, I would guess that exact width
would be maintained on any system the program is installed to even the
scrollbars for that system are different from those on the developer's
computer. So the only thing the Width property of a ScrollBar control
would tell one's program is the width of scroll bars on the original
developer's system at the time the ScrollBar control was added to the
form.

However, your posting brought up an interesting fact. It looks like the
values returned by the API constants I posted in my last message to this
thread are all off by one pixel. For my system, these constants all
returned the width of my scrollbars to be 17 pixels. However, a
ScrollBar controls has a width of 270 TWIPS on my system. Dividing that
by Screen.TwipsPerPixelX (15 for my system) tells me that the ScrollBar
control is 18 pixels wide. So, I opened the Magnifier applet that comes
with Windows and counted the number of pixels a scrollbar on a window
has... it was 18. That seems to mean that the API is returning a value
that is one pixel too small. Anyone out there more familiar with the API
functions have an explanation for this discrepency?

Rick - MVP<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Scroll Bars 
Back to top
Login to vote
Steve Gerrard1

External


Since: Aug 04, 2004
Posts: 9



(Msg. 5) Posted: Tue Feb 22, 2005 7:35 pm
Post subject: Re: Scroll Bars [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Rick Rothstein" <rickNOSPAMnews.DeleteThis@NOSPAMcomcast.net> wrote in message
news:U82dnchtI7mR94bfRVn-qA@comcast.com...
| However, your posting brought up an interesting fact. It looks like
the
| values returned by the API constants I posted in my last message to
this
| thread are all off by one pixel. For my system, these constants all
| returned the width of my scrollbars to be 17 pixels. However, a
| ScrollBar controls has a width of 270 TWIPS on my system. Dividing
that
| by Screen.TwipsPerPixelX (15 for my system) tells me that the
ScrollBar
| control is 18 pixels wide. So, I opened the Magnifier applet that
comes
| with Windows and counted the number of pixels a scrollbar on a window
| has... it was 18. That seems to mean that the API is returning a value
| that is one pixel too small. Anyone out there more familiar with the
API
| functions have an explanation for this discrepency?
|

On my system both the H and V scrollbars are 255 twips wide, i.e. 17
pixels, which is what the metrics report as well.

You can make scrollbars on a VB form be any width; the metrics return
the width of the std windows scrollbar. Maybe you nudged them a little
or snapped to a grid setting or something? I just double-clicked them on
the toolbar so they would go on the form at std width, and they came in
at 255.
 >> Stay informed about: Scroll Bars 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]