Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Programmer's Encyc Home
guest| Join | Help | Sign In
Liberty BASIC Programmer's Encyc
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members

Home

General Tutorials
Advanced Tutorials
GUI Programming
Graphics and Games
Strings and Text
Numbers and Math
Using Files
Windows API
Communications
Programmer's Tools

Articles by Date
FAQs
Rosetta Code
General Articles
Newsletters Contents

Table of Contents
Demos

Submit Articles
TOS and License

ButtonCoordinates

Edit 1 …
  • 1 Tags
    • tutorials
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

JanetTerra JanetTerra Dec 3, 2009

The original explanation and code was written by - JohnDavidson JohnDavidson and can be found in this thread at the Just BASIC Forums .

Try running this demo and hit the maximize/restore button.
Notice the coordinates in each button. They are specified differently for each corner.

 nomainwin 

WindowWidth = 380
WindowHeight = 240
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)

button #1.b1, "Upper Left", [p], UL, 26, 16, 90, 25
button #1.b2, "Upper Right", [p], UR, 26, 16, 90, 25
button #1.b3, "Lower Left", [p], LL, 26, 0, 90, 25
button #1.b4, "Lower Right", [p], LR, 80, 16, 90, 25

open "untitled" for window as #1
print #1, "trapclose [quit.1]"
print #1, "font MS_Sans_Serif 8"
[p]
wait

[quit.1]
Close #1
END

Note that you cannot use the same values for UL, UR, LL, and LR and expect the buttons to be evenly distanced from each corner.




Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://lbpe.wikispaces.com/ are licensed under a Custom License.
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...