Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

How to use "Sender" in click-events?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-19-2008, 07:15 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 269
Default How to use "Sender" in click-events?

Hi,

I've got a program with a bunch of images on which can be clicked. All subs have the same structure with just one difference: the name of the image. Can this be reduced to ONE sub in which the Sender-feature is used?
example:

Code:
Sub <font color="Red">Img1_Click  'img2_click, img3_click etc</font>
  If Deck(SuitNr) = 0 Then
    CheckCard
    <font color=
"Red">img1.Image = Cards.RetrieveImage 'img2, img3 etc</font>
    If CardNr = Target Then 
      frmCards.Close
      ShowCards
    
End If
  
End If
End Sub
thnx
Marc
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 07:34 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi Stellaferox,

first add an identical event to all your images like
Code:
AddEvent("img1", Click, "Image_Click")
AddEvent(
"img2", Click, "Image_Click")
AddEvent(
"img3", Click, "Image_Click")
Then you can
Code:
Sub Imgage_Click
  
If Deck(SuitNr) = 0 Then
    CheckCard
    Control(
Sender).Image = Cards.RetrieveImage
    
If CardNr = Target Then 
      frmCards.Close
      ShowCards
    
End If
  
End If
End Sub

specci48
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 07:38 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 269
Default

Hi Specci48,

You've been most helpfull...
Thanks very much!!!
Marc
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 07:51 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Stellaferox View Post
You've been most helpfull...
That's the aim of all users of this forum...

specci48
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 06:00 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

This tutorial should also be helpful: http://www.basic4ppc.com/forum/tutorials/907-runtime-controls-manipulation.html
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
"AddEvent" and "buttonUp/buttonDown" Byak@ Questions (Windows Mobile) 12 09-10-2008 03:04 PM
Is there any thing like Visual Basic "Tabbed dialog control" in Basic4ppc? mozaharul Questions (Windows Mobile) 6 03-23-2008 11:07 AM
Icon / Image in a Table to "Click" on burd27 Questions (Windows Mobile) 2 03-16-2008 03:04 AM
Image Button kommt nicht wieder "hoch" troll German Forum 3 02-22-2008 09:03 AM
calling the device's "Programs" or "settings" screens HarleyM Questions (Windows Mobile) 0 12-05-2007 02:59 AM


All times are GMT. The time now is 07:01 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0