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

Go Back   Android Development Forum - Basic4android > Foreign Languages > French Forum
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

sender renvoie un tag null

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-31-2011, 03:35 PM
Knows the basics
 
Join Date: May 2011
Posts: 66
Default sender renvoie un tag null

Bonjour,

Dans mon projet en cours j'ai un petit soucis avec la création de label en dynamique quand je clique sur le label je reçois un tag "null"

voici le bout de code qui me pose probleme
Sub Globals
Type accessoire (data(20) As String)
Dim label_projet(50) As accessoire
Dim panel1 As Panel
Dim panel2 As Panel
Dim change As Boolean
Dim ct1 As CustomToast
Dim btnGRILLE(1200) As Label
Dim blkcolor(1200) As Int
Dim labelprojet(50) As Label
Dim blccolor As Int
Dim selection As Int
blccolor=Colors.White
Dim data_tmp(20) As EditText
Dim index_label As Int

.....

.....

Sub creerlabel
index_label=index_label+1
labelprojet(index_label).Initialize ("LabelProjet")
labelprojet(index_label).Text=data_tmp(0).Text & "-" & index_label
labelprojet(index_label).TextColor=data_tmp(5).Tex t
labelprojet(index_label).Color=data_tmp(6).Text
labelprojet(index_label).TextSize=data_tmp(7).Text

'affiche le label
panel1.AddView(labelprojet(index_label), data_tmp(2).Text,data_tmp(1).Text, data_tmp(3).Text,data_tmp(4).Text)
'enregisre data
label_projet(index_label).Initialize
For i=0 To 7
label_projet(index_label).data(i)=data_tmp(i).Text
Next
panel2.RemoveView
change= True
End Sub

Sub LabelProjet_click
Dim LabelSelect As Label
LabelSelect = Sender
ToastMessageShow(labelSelect.Tag,True)
End Sub

merci !

et meilleurs voeux pour 2012 à toute l'equipe de B4A !!

Last edited by alan1968 : 12-31-2011 at 03:50 PM.
Reply With Quote
  #2 (permalink)  
Old 12-31-2011, 05:08 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Dim labelprojet(50) As Label
ne sert à rien.
La routine doit être comme suit:
Code:
Sub creerlabel
    index_label=index_label+
1
    
Dim lbl As Label
    lbl.Initialize (
"LabelProjet")
    lbl.Text=data_tmp(
0).Text & "-" & index_label
    lbl.TextColor=data_tmp(
5).Tex t
    lbl.Color=data_tmp(
6).Text
    lbl.TextSize=data_tmp(
7).Text
    lbl.Tag = index_label

    
'affiche le label
    panel1.AddView(labelprojet(index_label), data_tmp(2).Text,data_tmp(1).Text, data_tmp(3).Text,data_tmp(4).Text)
    
'enregisre data
    label_projet(index_label).Initialize
    
For i=0 To 7
        label_projet(index_label).data(i)=data_tmp(i).Text
    
Next
    panel2.RemoveView    
'?????
    change= True
End Sub
Il est nécessaire de déclarer chaque nouveau Label avec un Dim pour générer une nouvelle instance.
Il faut définir expressément la propriété Tag.

Meilleures salutations et Bonne Année
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #3 (permalink)  
Old 12-31-2011, 05:12 PM
Knows the basics
 
Join Date: May 2011
Posts: 66
Default

merci !
cela fontionne !!

et bonne fete !
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
Control & Sender copiloto Basic4android Updates and Questions 8 04-23-2011 06:18 PM
AddEvent Sender etc ? klaus Beta 7 11-07-2010 08:54 AM
Sender anomaly agraham Bug Reports 1 10-15-2009 06:33 PM
Resolve Sender ambiguity agraham Basic4ppc Wishlist 6 12-31-2008 11:11 AM
Sender returning control name derez Bug Reports 2 10-21-2007 06:44 PM


All times are GMT. The time now is 06:01 PM.


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