Hi,
i try to drag and drop my tabpage, to change the order of this tabpage.
I managed to do this code but it's not really the good way for do that.
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
what I would like to do is that if we hold the element farther than the next half then it is moved to the index
with my solution I can move the tabpane but it's not clean
Someone would have an idea to realize its more neatly ?
			
			i try to drag and drop my tabpage, to change the order of this tabpage.
I managed to do this code but it's not really the good way for do that.
			
				B4X:
			
		
		
		Sub TabPaneMatiere_MouseDragged (EventData As MouseEvent)
    moveTabPane(EventData.X,TabPaneMatiere)  
End Sub
Sub moveTabPane(posX As Double,tabPane As TabPane)  
    Dim n As Int = tabPane.SelectedIndex
    Dim valeur As Int = 75
   
    Dim t As TabPage = tabPane.Tabs.Get(n)
   
   
    If posX>num+valeur Then
        If n<tabPane.Tabs.Size-1 Then
            tabPane.Tabs.RemoveAt(n)
            tabPane.Tabs.InsertAt(n+1,t)
            tabPane.SelectedIndex=n+1
            num = posX
            Log("droite")
        End If
    Else
        If posX<num-valeur Then
            If n>0 Then
                tabPane.Tabs.RemoveAt(n)
                tabPane.Tabs.InsertAt(n-1,t)
                tabPane.SelectedIndex=n-1
                num = posX
                Log("gauche")
            End If
        End If
    End If
End Sub
	what I would like to do is that if we hold the element farther than the next half then it is moved to the index
with my solution I can move the tabpane but it's not clean
Someone would have an idea to realize its more neatly ?
			
				Last edited: