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.


Click function


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-31-2007, 09:04 PM
Senior Member
 
Join Date: Oct 2007
Posts: 147
Default Click function

Well... I'm making my first program on the ppc and I was using the function Click on image boxes to change the colour of them. On the computer it works perfectly but then on the ppc the image boxes don't show up at all, so I can't click on them. This is my code...

Code:
Sub Globals

End Sub

Sub App_Start
	Form1.Show
End Sub

Sub Image2_Click
Image2.color = 255,0,0
End Sub
Sub Image3_Click
Image3.color = 255,0,0
End Sub
Sub Image4_Click
Image4.color = 255,0,0
End Sub
Sub Image5_Click
Image5.color = 255,0,0
End Sub
Sub Image6_Click
Image6.color = 255,0,0
End Sub
Sub Image7_Click
Image7.color = 255,0,0
End Sub
Sub Image8_Click
Image8.color = 255,0,0
End Sub
Sub Image9_Click
Image9.color = 255,0,0
End Sub
Sub Image10_Click
Image10.color = 255,0,0
End Sub
Sub Image11_Click
Image11.color = 255,0,0
End Sub
Sub Image12_Click
Image12.color = 255,0,0
End Sub
Sub Image13_Click
Image13.color = 255,0,0
End Sub
Sub Image14_Click
Image14.color = 255,0,0
End Sub
Sub Image15_Click
Image15.color = 255,0,0
End Sub
Sub Image16_Click
Image16.color = 255,0,0
End Sub
Sub Image17_Click
Image17.color = 255,0,0
End Sub
Sub Image18_Click
Image18.color = 255,0,0
End Sub
Sub Image19_Click
Image19.color = 255,0,0
End Sub
Sub Image20_Click
Image20.color = 255,0,0
End Sub
Sub Image21_Click
Image21.color = 255,0,0
End Sub
Sub Image22_Click
Image22.color = 255,0,0
End Sub
Sub Image23_Click
Image23.color = 255,0,0
End Sub
Sub Image24_Click
Image24.color = 255,0,0
End Sub
Sub Image25_Click
Image25.color = 255,0,0
End Sub
Sub Image26_Click
Image26.color = 255,0,0
End Sub
Sub Image27_Click
Image27.color = 255,0,0
End Sub
Sub Image28_Click
Image28.color = 255,0,0
End Sub
Sub Image29_Click
Image29.color = 255,0,0
End Sub
Sub Image30_Click
Image30.color = 255,0,0
End Sub
Sub Image31_Click
Image31.color = 255,0,0
End Sub
Sub Image32_Tap
Image32.color = 255,0,0
End Sub

Sub Form1_Show

End Sub
Thanks for any help you can give me!
Reply With Quote
  #2 (permalink)  
Old 10-31-2007, 09:32 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

Can you upload your source code as a file?
BTW, you can change your code to:
Code:
Sub App_Start
 Form1.Show
 For i = 2 to 32
  AddEvent("Image" & i, Click, "ImageClick")
 Next
End Sub

Sub ImageClick
 Sender.Color = cRed
End Sub
It is a bit shorter
See this tutorial for more information: Runtime controls manipulation
Reply With Quote
  #3 (permalink)  
Old 10-31-2007, 09:38 PM
Senior Member
 
Join Date: Oct 2007
Posts: 147
Default

That is a bit shorter... lol!

I'll upload it as a source code... here you go
Reply With Quote
  #4 (permalink)  
Old 10-31-2007, 09:54 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

Your code works fine here.
What device are you using?
If it is a Pocket PC 2002 or WM2003 (not SE) then you should install .Net CF 1.0 SP3.
Reply With Quote
  #5 (permalink)  
Old 10-31-2007, 10:02 PM
Senior Member
 
Join Date: Oct 2007
Posts: 147
Default

I'll try installing it... my pocket pc is normal 2003.

How would you do it so that it is single pixels (instead of boxes) that can be draged on?

EDIT: it works now... thanks! Now however when it is on my pocket pc the boaxes are a bit spaced out randomly.

Last edited by neilnapier : 10-31-2007 at 10:09 PM.
Reply With Quote
  #6 (permalink)  
Old 10-31-2007, 10:06 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

What are you trying to achieve?
Reply With Quote
  #7 (permalink)  
Old 10-31-2007, 10:13 PM
Senior Member
 
Join Date: Oct 2007
Posts: 147
Default

Have you ever heard of the game Falling Sand?

Something along the lines of that... (of course as I have just started to learn how to code so it will take a while) but that is what I hope to achieve.
Reply With Quote
  #8 (permalink)  
Old 11-01-2007, 05:03 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

You should draw directly on the form.
Use Form_MouseDown / MouseMove / MouseUp events.
Reply With Quote
  #9 (permalink)  
Old 11-01-2007, 09:50 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,690
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Erel View Post
If it is a Pocket PC 2002 or WM2003 (not SE) then you should install .Net CF 1.0 SP3.
Erel - I've remarked on this before. You seem still to be under the impression that all 2003SE based devices come with SP3. This is not so. The Axim X30, for one, comes with only SP2 in ROM and requires SP3 to be installed for B4PPC to operate correctly.
Reply With Quote
  #10 (permalink)  
Old 11-01-2007, 10:02 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

I wasn't accurate earlier but .Net CF 1.0 SP2 is also fine for Basic4ppc.
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
Right Click designer functions scott93727 Basic4ppc Wishlist 1 10-31-2008 02:26 PM
Any way to generically detect a click anywhere? BurninSun Questions & Help Needed 3 07-19-2008 12:16 AM
Right Click ?? pegamaster Questions & Help Needed 2 07-07-2008 07:11 PM
Click and drag during runtime J12345T Questions & Help Needed 1 06-24-2008 10:37 AM
Click event during a for loop pmu5757 Questions & Help Needed 7 04-12-2008 04:44 PM


All times are GMT. The time now is 03:53 AM.


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