' How to create multiple navigable forms DECLARE SUB SetFocus LIB "USER32" ALIAS "SetFocus" (HWnd AS LONG) DECLARE SUB Button1Click (Sender AS QBUTTON) DECLARE SUB Button2Click (Sender AS QBUTTON) CREATE Form1 AS QFORM Caption = "Form 1" Width = 200 Height = 80 Left = 350 CREATE Button1 AS QBUTTON Caption = "Click me!" OnClick = Button1Click END CREATE Show END CREATE CREATE Form2 AS QFORM Caption = "Form 2" CREATE Button2 AS QBUTTON Caption = "Click me!" OnClick = Button2Click END CREATE Show END CREATE SUB Button1Click (Sender AS QBUTTON) SetFocus(Form2.Handle) Button1.Caption = "Click me!" Button2.Caption = "No, click me!" END SUB SUB Button2Click (Sender AS QBUTTON) SetFocus(Form1.Handle) Button2.Caption = "Click me!" Button1.Caption = "No, click me!" END SUB DO DoEvents '-- Process events from either form LOOP UNTIL Form1.Visible = 0 AND Form2.Visible = 0