Thanks to visit codestin.com
Credit goes to github.com

Skip to content

VBA.InputBox's vertical/horizontal position not 100% same as VB6 #2313

@Kr00l

Description

@Kr00l

Describe the bug
If YPos is omitted, the dialog box is vertically positioned approximately one-third of the way down the screen

To Reproduce
Call VBA.InputBox() and omit YPos

Expected behavior
The vertical position is a few pixels off when comparing VB6 and tB.
I don't know how tB is vertically position it but below code is behaving like what VB6 does.

Dim WndRect As RECT
GetWindowRect hDlg, WndRect
Dim RCWork As RECT
SystemParametersInfo SPI_GETWORKAREA, 0, VarPtr(RCWork), 0
Dim X As Long, Y As Long
X = RCWork.Left + (RCWork.Right - RCWork.Left - (WndRect.Right - WndRect.Left)) \ 2
Y = RCWork.Top + (RCWork.Bottom - RCWork.Top - (WndRect.Bottom - WndRect.Top)) \ 3

Screenshots
n/a

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • twinBASIC compiler version [e.g. 0.9.1111]

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions