Some Invalid DrawMode Values Return 1-16 Instead of Error

ID Number: Q75174

1.00

WINDOWS

buglist1.00

Summary:

The Microsoft Visual Basic DrawMode property will not give an error

for some invalid values. For example, numbers in the range 257 to 272,

513 to 528, and so forth, and for negative numbers in the range -240

to -255, -496 to -511, and so forth.

Microsoft has confirmed this to be a problem in Microsoft Visual Basic

programming system version 1.0 for Windows. We are researching this

problem and will post new information here as it becomes available.

More Information:

The code below demonstrates the problem. When you run this program,

the DrawMode is assigned to 257, and when the DrawMode is printed, it

prints 1, showing that the values are mapping onto 1 through 16.

Example

-------

1. In the VB.EXE environment, create a New Form.

2. In the Form_GotFocus event procedure, add the following lines of

code:

DrawMode = 257

Print DrawMode

3. Run the program (press F5). The program will incorrectly display a

1 on the form, instead of giving the error message "Illegal

Property Value."

By analyzing the range of values that map onto 1 through 16, any

number that satisfies the following equation will not generate an

error, but will instead give values in the range of 1 to 16:

Number = (x * 256) + y

where x is a whole number between -128 and 127, and y is between 1 and

16 inclusive (that is, any number in the range of a multiple of 256

plus 1 to 16 will map onto 1 through 16).

Additional reference words: 1.00