Italian B4J - Passare da un Modulo di codice ad un'altro

GIS

Well-Known Member
Licensed User
che stressss. Ho trovato in un esempio funzionante che per passare ad un'altro modulo utilizza nomemodulo.Show e successivamente chiude il precedente con nomemodulo.close a me non mi da la possibilita di inserire .Show. Mi da solo due opzioni o .AppStart o .Process.Globals
Allego file.
Come devo fare, o meglio cosa sbaglio?

B4X:
#Region Project Attributes
    #MainFormWidth: 800
    #MainFormHeight: 600
#End Region

Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    
    MainForm = Form1
    MainForm.RootPane.LoadLayout("mio") 'Load the layout file.
    MainForm.SetWindowSizeLimits(400, 400, 800, 800)
    Form1.Title = "MEMORY Ver.4.0 By 184"
    MainForm.Show
End Sub
Sub MenuBar1_Action
    Dim mi As MenuItem = Sender
    
    'Log(mi.text)
    If mi.Text = "CODICI BOBINE" Then Log("CODICI BOBINE")
    If mi.Text = "STAMPA ETI.BOBINE" Then Log("STAMPA ETI.BOBINE")
    If mi.Text = "SCHEDE" Then     
        Log("SCHEDE")
        
        sSchede
    End If
    
    If mi.Text = "MT. LINEA" Then Log("MT. LINEA")
    
End Sub

Sub sSchede
    
    '*****************************************
        mSchede.?????????????????
        MainForm.Close
    
    '****************************************
End Sub


'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    Return True
End Sub
 

Attachments

  • ThreePages.zip
    53.4 KB · Views: 205

LucaMs

Expert
Licensed User
Longtime User
Premesso che in questo momento non sono al massimo della lucidità... qual'è il problema?

Ho effettuato una sorta di login, arrivato allo User Form e il Logout mi riporta al form di Login.

Cosa vuoi ottenere, invece?
 
Last edited:

GIS

Well-Known Member
Licensed User
quello è solo un esempio che ho trovato per il passaggio tra due moduli...il mio è quello che ho messo nel code:


sub sSchede
 

LucaMs

Expert
Licensed User
Longtime User
Allora...

Erel crea un modulo di codice per ogni Form, in quell'esempio.

In ognuno di quei moduli di codice, dichiara un Form, crea una routine Show che inizializza (se necessario) un Form e lo mostra (show).

Se non è chiaro, allega il tuo progetto oppure mandamelo in privato, che se non m'addormento gli dò un'occhiata ;)
 

GIS

Well-Known Member
Licensed User
non ti basta quello che ho messo nel Thread di apertura?
 

GIS

Well-Known Member
Licensed User
il problema era questo?

B4X:
Public Sub Show
    If frm.IsInitialized = False Then
        frm.Initialize("frm", 400, 400)
        frm.RootPane.LoadLayout("vSchede")
    End If
    frm.Show
End Sub
 
Top