Error when moving treeview to a tabcontrol

Peter

Member
Licensed User
I'm trying to move a treeview control to a tab page.
Basic4PPC responds with the error message : Unable to cast object of type 'Dbasic.Other.SwrapObject' to type 'System.Windows.Forms.Control'

Am I doing something wrong?

B4X:
Sub App_Start

   Form1.Show
   sip(true)
   AddLabel (form1,"Label2", 5, 5, 60, 20, "Option:")
   AddTextBox (Form1,"TextBox1",40,20,100,25,"")
   tbc.New1 ("Form1", -5,0, 245, 280)
      tbc.AddTabPage("Aantallen")   
        tbc.AddTabPage("Hoorspel")
         tbc.AddTabPage("Personen")
      tbc.AddTabPage("Zoeken")
      tbc.AddTabPage("Lijsten")
      tbc.AddTabPage("X")
      tbc.AddTabPage("Z")
      tbc.AddTabPage("Configuratie")
      'tbc.AddControl("label1",0,20,20)
      tbc.AddControl("label2",0,20,60)      
   Con.New1
   Reader.New1
   tv.New1("Form1", 5, 5, Form1.Width - 10, Form1.Height - 10)   
   Node.New1
   [COLOR="Red"]tbc.AddControl("tv",1,20,20)[/COLOR]
   Cmd.New1("",con.Value)
   Con.Open("Data Source = " & AppPath & "\DNH4ppc.sl3")

End Sub
 

Peter

Member
Licensed User
Thank you, Erel, that works.

Could i have found that in one of the help-files?

Peter
 
Top