Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Error when moving treeview to a tabcontrol


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-14-2007, 09:42 PM
Peter's Avatar
Junior Member
 
Join Date: May 2007
Location: The Netherlands
Posts: 18
Default Error when moving treeview to a tabcontrol

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?

Code:
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
	tbc.AddControl("tv",1,20,20)
	Cmd.New1("",con.Value)
	Con.Open("Data Source = " & AppPath & "\DNH4ppc.sl3")

End Sub
__________________
PC : P4 3gHz, 512 MiB
PPC : Asus A600 + 1 GiB SD
---------------------------------------------------
(Reminder to self: )
Reply With Quote
  #2 (permalink)  
Old 05-15-2007, 06:42 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

The right syntax is:
tbc.AddControl(tv.Control,1,20,20)

This is different than regular controls because TreeView is not a built-in control.
Reply With Quote
  #3 (permalink)  
Old 05-15-2007, 07:36 AM
Peter's Avatar
Junior Member
 
Join Date: May 2007
Location: The Netherlands
Posts: 18
Default

Thank you, Erel, that works.

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

Peter
__________________
PC : P4 3gHz, 512 MiB
PPC : Asus A600 + 1 GiB SD
---------------------------------------------------
(Reminder to self: )
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing and moving a Character Transparently (Not a Sprite) Drewpeu Questions & Help Needed 2 10-08-2008 04:15 PM
Diff GPS values without moving GPS mouse Georg Questions & Help Needed 1 04-22-2008 07:58 AM
VGA + TabControl Elrick Questions & Help Needed 10 04-16-2008 02:25 PM
moving a sprite? colin9876 Questions & Help Needed 7 11-27-2007 05:10 PM
How to create sprite/ moving figures? Stellaferox Questions & Help Needed 11 05-17-2007 07:05 PM


All times are GMT. The time now is 02:38 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0