Hi Guys, 
I have a really strange thing going on here.
I have a panel with a button and listview on it, if you press the back button I want the panel to disappear, that works.
But I also want if you press the button the panel also disapears. But that doesn't work, and the strang thing is the program doesn't read the entire sub, because I put a msgbox in it, but the msgbox also doesn't appear.
Here is my code (only the relevant part:, I renamed the views to make it more clear).
ButtonShowPanel is made with the designer, the others are made in the code.
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
This is the sub that the program doesn't read:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Thanks in advance!
Best Regards,
PhilippeK
PS Sorry for my bad English :sign0104:.
			
			I have a really strange thing going on here.
I have a panel with a button and listview on it, if you press the back button I want the panel to disappear, that works.
But I also want if you press the button the panel also disapears. But that doesn't work, and the strang thing is the program doesn't read the entire sub, because I put a msgbox in it, but the msgbox also doesn't appear.
Here is my code (only the relevant part:, I renamed the views to make it more clear).
ButtonShowPanel is made with the designer, the others are made in the code.
			
				B4X:
			
		
		
		Sub Globals
dim Panel1 as panel
dim Listview as listview
dim buttonExitPanel as button
dim buttonShowPanel as button
dim IO as int
end sub
			
				B4X:
			
		
		
		Sub activity_keypress (KeyCode As Int) As Boolean   
   If keycode = KeyCodes.KEYCODE_BACK Then
      If IO = 1 Then 
         panel1.RemoveView
         listview1.RemoveView
         buttonExitPanel.RemoveView
         IO = 0
         Return True
               end if
end if
end sub
			
				B4X:
			
		
		
		Sub ButtonShowPanel_Click
   IO = 1
   Panel1.Initialize("")
   Listview1.Initialize("Listview1")
   activity.AddView(Panel1,  0, 0, 100%x, 100%y)
   Listview1.Visible = True
   Panel1.Visible = True
   Listview1.Color = Colors.black
   Panel1.Visible = True
   Panel1.Color = Colors.black
   Panel1.AddView(Listview1, 0, 50, 100%x, 100%y-40dip)
   ButtonExitPanel.Initialize("")
   Panel1.AddView(ButtonExitPanel,0,0,110,50)
   ButtonExitPanel.Text = "Exit Smith"
   ButtonExitPanel.TextSize = 9
   ButtonExitPanel.Enabled = True 
   activity.Invalidate
End SubThis is the sub that the program doesn't read:
			
				B4X:
			
		
		
		Sub ButtonExitPanel_Click
   Msgbox("Exit Test", "TEST")
   If IO = 1 Then 
      Panel1.RemoveView 
      listview1.RemoveView 
      ButtonExitPanel.RemoveView
      IO = 0
         
   End IfThanks in advance!
Best Regards,
PhilippeK
PS Sorry for my bad English :sign0104:.
			
				Last edited: 
			
		
	
								
								
									
	
		
			
		
	
								
							
							 
				 
 
		 
 
		