Microsoft KB Archive/40373

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 14:14, 21 July 2020 by X010 (talk | contribs) (Text replacement - "&" to "&")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


Scroll Bar Cannot Be Placed in Right Bar of WINDOW Type 1 or 7

Article ID: 40373

Article Last Modified on 1/9/2003



APPLIES TO

  • Microsoft QuickBasic Compiler for Macintosh 1.0



This article was previously published under Q40373

SUMMARY

Creating a window with type 1, 7, -1, or -7 with the WINDOW statement in QuickBASIC for the Apple Macintosh creates a window that has a title bar and a size box. A vertical box (a bar) in the window above the size box has proportions that seems to invite adding a scroll bar. However, when you place a scroll bar in this section of the window using NewScroll (which is an MBLC routine in QuickBASIC), the scroll bar does not appear. This is a design limitation of window types 1, 7, -1, and -7 in QuickBASIC.

The area of the window directly above the size box is considered part of the window border. The border of a window is not a valid display area. An attempt to write on the border of a window is considered outside the window's display area and nothing is written by NewScroll (or any other statement).

MORE INFORMATION

To work around this design limitation, a scroll bar can be placed flush with the outer edge of a window by using one of the other window types (2, 3, 4, 5, 6, -2, -3, -4, -5, or -6), which have only a narrow border. Another option is to place the scroll bar on the left-hand side of the window where the border is narrow in every window type.

The following program shows two different types of windows. The window with a type of 1 does not allow the scroll bar to be flush against the right-hand side of the window, while window type 2 allows the scroll bar.

The following is a code example:

WINDOW 2,"Test Window",(50,100)-(250,300),1
DIM scr%(5)
SetRect scr%(0),179,0,195,185
h&=0
vis%=1
min%=0
max%=5
value%=0
NewScroll h&,scr%(0),vis%,min%,max%,value%

WINDOW 3,"Test Window 2",(275,90)-(450,295),2
SetRect scr%(0),162,0,175,205
h&=0
vis%=1
min%=0
max%=5
value%=0
NewScroll h&,scr%(0),vis%,min%,max%,value%
                


Additional query words: MQuickB

Keywords: KB40373