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.


addimage trouble


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2007, 08:14 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default addimage trouble

Hi,
I'm tryingf to add an image in rumtime, but am getting sintax error...

here the line thath error out

addimage(control("panel"&NumbPanel+1),"icon",180,0 ,20,20)


"Panel"&NumbPanel is a runtime created panel

if i replace "Panel"&NumbPanel by panel2, wich i know is created, it works...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #2 (permalink)  
Old 05-08-2007, 08:23 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I'd suggest placing MsgBox("panel"&NumbPanel+1) prior to your line that faults so that you can see which control is actually being used. It could be that you don't have the values you think you do.

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #3 (permalink)  
Old 05-08-2007, 08:33 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

HI,

Thanks RandomCoder, Ialready thought of that, and I can't see the error...

The entire sub is as follows

Sub Button1_Click
'adds a first panel
addpanel(form1,"panel"&NumbPanel,50,50,150,100)
control("panel"&NumbPanel).color=csilver
'adds a panel within the previous panel
addpanel(form1,"panel"&NumbPanel+1,50,50,150,20)
control("panel"&NumbPanel+1).color=cblue
'necessary to bring the correct panel to front
control("panel"&NumbPanel).BringToFront
control("panel"&NumbPanel+1).BringToFront
'ads an image to the second panel
addimage(panel2,"icon",130,0,20,20)
control("icon").image="close.png"
control("icon").BringToFront
End Sub
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #4 (permalink)  
Old 05-08-2007, 09:12 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I could be way off the mark here but if NumbPanel hasn't beeb assigned a value then it is set to zero. Therefore NumbPanel+1 is equal to 1 not 2.
But you say that it works with the message box present but errors when its removed. That makes me think that its a timing issue?

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #5 (permalink)  
Old 05-08-2007, 09:22 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

Until the next version you can't use a string or a variable as the parent control.
You must write: AddImage (Panel1,...
Reply With Quote
  #6 (permalink)  
Old 05-08-2007, 09:29 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

thanks Erel, I was starting to go cuco....
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
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
Newbie having trouble with brush1.New1() mjcoon Questions & Help Needed 6 05-28-2008 08:11 PM
Table trouble Lasse Questions & Help Needed 1 01-15-2008 10:37 PM
addimage don't load picture? tvrman Questions & Help Needed 5 09-03-2007 05:55 PM
Table Trouble RandomCoder Questions & Help Needed 2 07-15-2007 10:07 AM
Table trouble RandomCoder Questions & Help Needed 5 05-09-2007 07:31 AM


All times are GMT. The time now is 09:57 PM.


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