I create a window with a few button and wonder how to open another window or two when click on the button where the section of code is frmMainMenu and then second is frm_Simple_New
import frm_Simple_New
Public Window frmMainMenu_Layout
Title = "Main Menu"
Frame = (200, 200, 600, 300)
Control Button btn_Best
Caption = "Open Best"
Frame = (100, 150, 300, 32)
end Control
End Window
Public Class frmMainMenu_Window inherits frmMainMenu_Layout
Public Overrides Sub btn_Best_Action()
Dim w1 As New frm_Simple_New_Window()
w1.Show()
End Sub
End Class
Sub Main()
Dim w As New frmMainMenu_Window()
w.Move(300, 300, 500, 300)
w.Show()
Application.Run()
End Sub
Const x_Old As String = "My Address"
Const x_New As String = "Your Address"
Public Window frm_Simple_New_Layout
Title = "Using Best"
Frame = (200, 200, 600, 300)
Control Label lbl_Address
Text = x_New + ":"
Frame = (16, 16, 120, 20)
End Control
Control TextArea ta_Address
Text = x_New
Frame = (136, 16, 300, 200)
End Control
Control Button btn_ChangeAddress
Caption = "Change Address"
Frame = (136, 224, 300, 32)
end Control
Control Button btn_ResetAddress
Caption = "Reset Address"
Frame = (136, 250, 300, 32)
end Control
End Window
Public Class frm_Simple_New_Window inherits frm_Simple_New_Layout
Public Overrides Sub btn_ChangeAddress_Action() ' generated hook
me.lbl_Address.Text = x_New + ":"
me.ta_Address.Text = x_New
print(me.lbl_Address.Text)
print("Set " + x_New)
End Sub
Public Overrides Sub btn_ResetAddress_Action() ' generated hook
me.lbl_Address.Text = x_Old + ":"
me.ta_Address.Text = x_Old
print(me.lbl_Address.Text)
print("Reset " + x_Old)
End Sub
End Class
Public Sub frm_Simple_New_Main()
Dim w As New frm_Simple_New_Window()
w.Move(300, 300, 500, 300)
w.Show()
Application.Run()
End Sub