BB___AUTORESIZE

=AUTORESIZE= toc =Graphics Method=

Description
> Automatically resizes a graphicbox control so the edge margins are maintained if a user resizes its containing window.

Hints

 * //**Using autoresize.**// If you use the autoresize command, you must also **flush** any graphics that you place on the graphicbox. Any graphic elements not flushed will be lost if the window is resized, or minimized and restored.

Example
code format="lb" nomainwin WindowWidth=500 WindowHeight=400

graphicbox #1.gb 10, 10, 400, 300

open "Autoresize Demo" for window as #1 #1 "trapclose [quit]" 'make the graphicbox able to be resized with the window #1.gb "autoresize"

wait

[quit] close #1 end code

Useful Functions
code format="lb" Place a useful function using this keyword here code

=Text Editor Method=

Description
> Enables the texteditor to resize along with the containing window, maintaining edge margins.

Hints

 * //**Sizing.**// If your window does not have a sizing frame (e.g. window_nf), you will not need to provide a way to resize the texteditor. But, if the window can be resized, it just makes sense to resize the texteditor when a user does change the window's size. That's the purpose of !autoresize, which works for texteditors only.
 * //**Caution.**// In JustBASIC, there is no native way to reposition controls if a user resizes a window. Be aware that a texteditor control that can be autoresized may end up covering other controls if its window is resized.

Example
code format="lb" nomainwin

WindowWidth=300 WindowHeight=400

statictext #h.st1 "Enter text data", 10, 15, 200, 20 texteditor #h.text 10, 35, 260, 150

open "" for window as #h #h "trapclose [quit]" #h.text "!autoresize"

wait

[quit] close #h end code

Useful Functions
code format="lb" Place a useful function using this keyword here code